<!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>导航1.0</title>
<style>
.nav li{float: left;list-style-type: none;}
.nav li a{text-decoration: none;color: #fff;width: 100px;height: 35px;
border: 1px solid #ddd;text-align: center;line-height: 35px;
background: teal;display: block;}
/* 鼠标悬停时显示的效果 */
.nav li a:hover{color: yellow;background: tomato;}
</style>
</head>
<body>
<ul class="nav">
<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>
</body>
</html>
鼠标移入前效果图
鼠标移入前效果图