当前位置:首页 > 设计在线 > 网页设计 > CSS/Xhtml > 用css网站布局之十步实录!(三)

用css网站布局之十步实录!(三)

点击次数:26 次 发布日期:2008-11-21 23:50:08 作者:源代码网
源代码网推荐

源代码网整理以下第三步:将网站分为五个div,网页基本布局的基础:

源代码网整理以下1.将“第一步”提到的五个部分都放入盒子中,在html文件中写入:

源代码网整理以下Example Source Code [

<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文件写入:

div css xhtml xml Example Source Code Example Source Code
#main-nav {
background: red;
height: 50px;
}
#header {
background: blue;
height: 150px;
}
#sidebar-a {
background: darkgreen;
}
#content {
background: green;
}
#footer {
background: orange;
height: 66px;
}

源代码网整理以下
  表现如下:

源代码网供稿.
网友评论 (0)
会员中心
设计在线
本站推荐
设计在线之精华