目录
一、效果展示
二、代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>导航条</title>
<style>
* {
padding: 0px;
margin: 0px;
}
body {
background-color: #bfa;
}
ul li {
list-style: none;
float: left;
}
ul {
width: 492px;
height: 48px;
background-color: #ffe;
margin: 40px auto;
}
li a {
color: #999;
line-height: 48px;
display: block;
text-decoration: none;
padding: 0px 10px;
}
li a:hover {
background-color: #444;
color: #eee;
}
</style>
</head>
<body>
<ul>
<li>
<a href="https://www.w3school.com.cn/h.asp">HTML/CSS</a>
</li>
<li>
<a href="https://www.w3school.com.cn/b.asp">Brower Side</a>
</li>
<li>
<a href="https://www.w3school.com.cn/s.asp">Sever Side</a>
</li>
<li>
<a href="https://www.w3school.com.cn/p.asp">Programming</a>
</li>
<li>
<a href="https://www.w3school.com.cn/x.asp">XML</a>
</li>
</ul>
</body>
</html>