结构是:一个大的box div套两个小的div,一个是title标题div,另一个是ul,li的div
重点:
代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
ul li{
list-style: none;
}
.box{
margin: 10px auto;
height: 327px;
width: 260px;
border: 1px solid green;
background-image: url(images1/bg.gif);
}
.title{
height: 23px;
margin-top: 10px;
border-left: 4px solid red;
margin-left: 10px;
color: yellow;
font-size: 16px;
line-height: 23px;
padding-left: 11px;
}
.list{
width: 240px;
height: 280px;
background-color: white;
margin-left: 10px;
margin-top: 5px;
}
.list ul{
margin-left: 10px;
margin-right: 10px;
}
.list li{
height: 30px;
border-bottom: 1px dashed #333333;
line-height: 30px;
font-size: 16px;
background-image: url(images1/tb.gif) ;
background-repeat: no-repeat;
background-position: left center;
padding-left: 15px;
}
.list a{
text-decoration: none;
}
</style>
</head>
<body>
<div class="box">
<div class="title">爱宠知识</div>
<div class="list">
<ul>
<li><a href="#">养狗比养猫更健康</a></li>
<li><a href="#">养狗比养猫更健康</a></li>
<li><a href="#">养狗比养猫更健康</a></li>
<li><a href="#">养狗比养猫更健康</a></li>
<li><a href="#">养狗比养猫更健康</a></li>
<li><a href="#">养狗比养猫更健康</a></li>
<li><a href="#">养狗比养猫更健康</a></li>
<li><a href="#">养狗比养猫更健康</a></li>
<li><a href="#">养狗比养猫更健康</a></li>
</ul>
</div>
</div>
</body>
</html>
网友评论