您的位置:首页 > Web前端 > CSS

HTML/CSS写列表

2018-01-12 12:48 155 查看


<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>LIST</title>
<link rel="stylesheet" href="css/list.css" />
</head>
<body>
<div id="wrapper">
<div class="tit">
<h3><a href="	">栏目标题</a></h3>
</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>
<li><a href="">第十个列表选项</a></li>
</ul>
</div>
</div>
</body>
</html>

body{
background-color: white;
font: 12px arial;
color: black;
}

a:link,a:visited{
text-decoration: none;
color: #333;
}

#wrapper{
width: 300px;
text-align: left;
}

.tit{
width: 100%;
height: 24px;
background: url(../img/titbg.gif);
}

.tit h3{
margin: 0px;
padding: 0px;
line-height: 24px;
font-size: 12px;
text-indent: 30px;
background: url(../img/tittb.gif) no-repeat 3% 50%;
}

.list{
width: 298px !important;
width: 300px;
/*IE6及以下浏览器width为300px,!important并没有覆盖后面的规则;其它浏览器下width为298px*/
float: left;
border: 1px solid #d8d8d8;
border-top: 0px;
}

ul{
list-style-type: none;
margin: 0px;
padding: 0px;
}

ul li{
float: left;
line-height: 20px;
width: 45%;
margin: 0px 5px;
background: url(../img/sidebottom.gif) repeat-x 0 bottom;
}

ul a{
padding-left: 12px;
background: url(../img/bullet.gif) no-repeat 0 50%;
}

ul a:hover{
text-decoration: underline;
color: #ff0000;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: