用HTML+css做既好看又实用的导航栏

    技术2022-07-10  91

    导航栏

    效果图如下: 代码如下:

    <!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title></title> <style type="text/css"> ul{/*设置导航栏的框框*/ margin: 30px auto; width: 600px; height: 350px; padding: 0px; } li{ list-style-type: none; float: left; } a{ display: block; width: 100px; height: 50px; font-family: Microsoft Yahei; line-height: 50px; background-color: crimson; margin: 0px 0px; color: #fff; text-align: center; text-decoration: none; font-size: 15px; } a:hover{ background-color: #2f6f4f; } </style> </head> <body> <div > <ul class=daohanglan> <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> <li><a href="">家居</a></li> </ul> </div> </body> </html>
    Processed: 0.034, SQL: 9