本文实例讲述了纯CSS实现的三列布局网页效果。分享给大家供大家参考。具体分析如下:
这是一个比较常用的用DIV+CSS布局的网页,包括头部、中间、一行三列布局、导航条、页面底部等,如果你正在用CSS布局一个网页,那么这段代码正好你能用得上,这种布局方式现在比较常用。
复制代码代码如下:
一个常用的纯CSS布局的网页*{
font-size:12px;
font-family:verdana;
margin:0px;
padding:0px;
}
a{
text-decoration:none;
}
#header,#footer{
width:85%;
margin:0 auto;
height:50px;
}
#header{
height:70px;
margin-top:5px;
border:solid 1px #000;
background:url() no-repeat right -20px;
}
#header h1{
line-height:40px;
}
#body{
position:relative;
width:85%;
margin:3px auto;
height:100%;
word-wrop:break-word;
word-break:break-all;
}
#sidebar{
position:absolute;
left:0;
top:0;
width:200px;
}
#right{
width:240px;
position:absolute;
right:0;
top:0;
}
#center{
margin:0 241px 0 201px;
}
#body,#sidebar,#right,#center,#footer{height:750px;border:solid 1px #000;}
#footer{
height:50px;
}
#body{
border:none;
}
#nav ul{
float:left;
width:600px;
list-style-type:none;
border-bottom:solid 6px #6666CC;
}
#nav ul li{
float:left;
}
#nav li a{
display:block;
text-decoration:none;
text-align:center;
width:50px;
padding:5px;
}
#nav li a:hover{
background:#66c;
color:#fff;
font-weight:bold;
}
dt{
border-bottom:dotted 1px #000066;
border-top:dotted 1px #006;
}
dt.first{
border-top:none;
}
dt{
padding:8px 0px 8px 4px;
}
dd a{
display:block;
text-indent:20px;
padding:10px;
}
dd a:hover{
font-weight:bold;
color:#000;
background:#66FFCC;
}
title
right
希望本文所述对大家的div+css网页设计有所帮助。