其他分享
首页 > 其他分享> > css html 导航条

css html 导航条

作者:互联网

在这里插入图片描述

<!DOCTYPE html>
<html lang="en">
<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>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        ul{
            list-style-type: none;
            overflow: hidden;
        }
        ul li{
            float: left;
            padding: 15px 10px;
        }
        ul li:hover{
            float: left;
            background-color:red;
            padding: 15px 10px;
        }
        #top{
            background-color:#01204f;
            color:#fff;
        }
    </style>
</head>
<body>
    <div id="top">
         <ul>
             <li>新闻</li>
             <li>国内</li>
             <li>国际</li>
             <li>军事</li>
             <li>财经</li>
         </ul>
    </div>
</body>
</html>

标签:color,float,li,padding,ul,html,导航条,15px,css
来源: https://blog.csdn.net/jialan75/article/details/122832123