您的位置:首页 > 运维架构 > 网站架构

第三步:将网站分为五个div,网页基本布局的基础:

2011-11-24 13:11 381 查看
1.将“第一步”提到的五个部分都放入盒子中,在html文件中写入:


Example Source Code[www.52css.com]
<div id="page-container">
<div id="main-nav">Main Nav</div>
<div id="header">Header</div>
<div id="sidebar-a">Sidebar A</div>
<div id="content">Content</div>
<div id="footer">Footer</div>
</div>

2.为了将五个部分区分开来,我们将这五个部分用不同的背景颜色标示出来,在css文件写入:


Example Source Code[www.52css.com]
#main-nav {
background: red;
height: 50px;
}
#header {
background: blue;
height: 150px;
}
#sidebar-a {
background: darkgreen;
}
#content {
background: green;
}
#footer {
background: orange;
height: 66px;
}

  表现如下:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: