css列表

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>列表</title>

<link href="css/css.css" rel="stylesheet" rel="stylesheet" type="text/css">

</head>
<body>


<div id="nav">
<h2 class="title">全部商品分类</h2>
<ul>
<li><a href="#">图书</a>&nbsp;&nbsp;<a href="#">音像</a>&nbsp;&nbsp;<a href="#">数字商品</a></li>
<li><a href="#">家用电器</a>&nbsp;&nbsp;<a href="#">手机</a>&nbsp;&nbsp;<a href="#">数码</a></li>
<li><a href="#">电脑</a>&nbsp;&nbsp;<a href="#">办公</a></li>
<li><a href="#">家居</a>&nbsp;&nbsp;<a href="#">家装</a>&nbsp;&nbsp;<a href="#">厨具</a></li>
<li><a href="#">服饰鞋帽</a>&nbsp;&nbsp;<a href="#">个化化妆</a></li>
<li><a href="#">礼品箱包</a>&nbsp;&nbsp;<a href="#">钟表</a>&nbsp;&nbsp;<a href="#">珠宝</a></li>
<li><a href="#">食品饮料</a>&nbsp;&nbsp;<a href="#">保健食品</a></li>
<li><a href="#">彩票</a>&nbsp;&nbsp;<a href="#">旅行</a>&nbsp;&nbsp;<a href="#">充值</a>&nbsp;&nbsp;<a href="#">票务</a></li>
</ul>
</div>


</body>
</html>



style.css:

#nav{
width: 227px;
}

.title{
font-size: 22px; /*字体大小*/
font-weight: bold; /*字体粗细*/
/*background: #e53333; !*颜色*!*/
text-indent: 1em; /*行间距*/
line-height: 25px; /*行高*/
background: red
}


/*list-style:
circle : 空心圆
none : 没有样式
decimal :数字
square :正方形
*/
ul li{
height: 37px; /*列间距*/
list-style: none; /*去除圆点样式*/
text-indent: 1em; /*行间距*/
background: #c2c2c2; /*背景颜色*/
}
/*ul li*/

a{
text-decoration: none; /*去除下划线*/
color: black; /*字体颜色*/
font-size: 14px; /*字体大小*/
}

a:hover{
color: #696ac4; /*鼠标悬浮变色*/
text-decoration: underline; /*鼠标悬浮时,增加下划线*/
}


posted @ 2022-07-30 21:11  书先生  阅读(23)  评论(0编辑  收藏  举报