![](https://img2020.cnblogs.com/blog/2216408/202103/2216408-20210323110647155-828616048.png)
![](https://img2020.cnblogs.com/blog/2216408/202103/2216408-20210323110723944-459921016.png)
<!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>
a {
display: inline-block;
width: 125px;
height: 58px;
/* line-height大一点就能字体偏下了 */
line-height: 45px;
text-decoration: none;
color: aliceblue;
background-color: pink;
text-align: center;
background: url(bg1.png) no-repeat;
}
a:hover {
background: url(bg2.png) no-repeat;
}
</style>
</head>
<body>
<a href="#" class="bg1">五彩导航栏</a>
<a href="#">五彩导航栏</a>
<a href="#">五彩导航栏</a>
<a href="#">五彩导航栏</a>
</body>
</html>