时间:2021-07-01 10:21:17 帮助过:36人阅读
list-style 简写属性。用于把所有用于列表的属性设置于一个声明中
list-style-image 将图象设置为列表项标志。
list-style-position 设置列表中列表项标志的位置。
list-style-type 设置列表项标志的类型。
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>3.CSS控制列表</title>
<style>
.list {
width: 350px;
height:500px;
/*background-color: lightskyblue;*/
border: 1px solid #696969;
border-radius: 2%;
color: #363636;
background-color: #fefefe;
}
.list h2 {
padding-left: 20px;
}
.item {
list-style-type:decimal;
list-style-position: inside;
padding: 10px;
}
.item li {
/*background-color: lightgreen;*/
}
.item li a {
text-decoration: none;
}
.item li a:hover {
text-decoration: underline;
color:#6CF;
font-size: 1.05em;
}
</style>
</head>
<body>
<div class="list">
<h2>头条公告</h2>
<ul class="item">
<li><a href="">物理学家史蒂芬·霍金去世,享年76岁</a></li>
<li><a href="">物理学家史蒂芬·霍金去世,享年76岁</a></li>
<li><a href="">物理学家史蒂芬·霍金去世,享年76岁</a></li>
<li><a href="">物理学家史蒂芬·霍金去世,享年76岁</a></li>
<li><a href="">物理学家史蒂芬·霍金去世,享年76岁</a></li>
<li><a href="">物理学家史蒂芬·霍金去世,享年76岁</a></li>
<li><a href="">物理学家史蒂芬·霍金去世,享年76岁</a></li>
<li><a href="">物理学家史蒂芬·霍金去世,享年76岁</a></li>
<li><a href="">物理学家史蒂芬·霍金去世,享年76岁</a></li>
</ul>
</div>
</body>
</html>以上就是CSS控制列表的详细内容,更多请关注Gxl网其它相关文章!