導航欄
效果圖如下:
代碼如下:
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title></title>
<style type="text/css">
ul{/*設置導航欄的框框*/
margin: 30px auto;
width: 600px;
height: 350px;
padding: 0px;
}
li{
list-style-type: none;
float: left;
}
a{
display: block;
width: 100px;
height: 50px;
font-family: Microsoft Yahei;
line-height: 50px;
background-color: crimson;
margin: 0px 0px;
color: #fff;
text-align: center;
text-decoration: none;
font-size: 15px;
}
a:hover{
background-color: #2f6f4f;
}
</style>
</head>
<body>
<div >
<ul class=daohanglan>
<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>
</body>
</html>