CSS彩色导航

 

<!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>Document</title>
    <style>
        .a1 {
            height: 58px;
            width: 120px;
            background-color: blue;
            background-image: url(bg1.png);
            display: inline-block;
            line-height: 50px;
            color: white;
            text-decoration: none;
            text-align: center;
        }
        
        .a2 {
            height: 58px;
            width: 120px;
            background-color: blue;
            background-image: url(bg3.png);
            display: inline-block;
            line-height: 50px;
            color: white;
            text-decoration: none;
            text-indent: 1.5em;
        }
        
        .a3 {
            height: 58px;
            width: 120px;
            background-color: blue;
            background-image: url(bg5.png);
            display: inline-block;
            line-height: 50px;
            color: white;
            text-decoration: none;
            text-indent: 1.5em;
        }
        
        .a4 {
            height: 58px;
            width: 120px;
            background-color: blue;
            background-image: url(bg22.png);
            display: inline-block;
            line-height: 50px;
            color: white;
            text-decoration: none;
            text-indent: 1.5em;
        }
        
        .a1:hover {
            color: violet;
            background-image: url(bg2.png);
        }
        
        .a2:hover {
            color: violet;
            background-image: url(bg11.png);
        }
        
        .a3:hover {
            color: violet;
            background-image: url(bg4.png);
        }
        
        .a4:hover {
            color: violet;
            background-image: url(bg1.png);
        }
    </style>
</head>

<body>
    <a href='#' class=a1>五彩导航</a>
    <a href='#' class=a2>五彩导航</a>
    <a href='#' class=a3>五彩导航</a>
    <a href='#' class=a4>五彩导航</a>
</body>

</html>


版权声明:本文为qq_45387575原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。