Front-end colorful navigation, the color can be changed when the mouse is passed

<!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>
 .nav a{
     display: inline-block;
     width: 120px;
     height: 58px;
     background-color: pink;
     text-align: center;
     line-height: 48px;
     color: #fff;
     text-decoration:none;
 }

 .nav .bg1{
     background: url(image/bg1.png) no-repeat;
 }
 .nav .bg1:hover{
     background-image: url(image/bg11.png);
 }


 .nav .bg2{
     background: url(image/bg2.png);
 }
 .nav .bg2:hover{
     background-image: url(image/bg22.png);
 }



 .nav .bg3{
     background: url(image/bg3.jpg);
 }
 .nav .bg3:hover{
     background-image: url(image/bg1.png);
 }


 .nav .bg4{
     background: url(image/bg4.png);
 }
 .nav .bg4:hover{
     background-image: url(image/bg2.png);
 }



 .nav .bg5{
     background: url(image/bg5.png);
 }
 .nav .bg5:hover{
     background-image: url(image/bg3.jpg);
 }

</style>
</head>
<body>
    <div class="nav">
        <a href="#" class="bg1"> 五彩导航</a>
        <a href="#" class="bg2"> 五彩导航</a>
        <a href="#" class="bg3"> 五彩导航</a>
        <a href="#" class="bg4">  五彩导航</a>
        <a href="#" class="bg5"> 五彩导航</a>
    </div>
</body>

</html>

Guess you like

Origin blog.csdn.net/qq_55061257/article/details/119009357