zoukankan      html  css  js  c++  java
  • CSS常用操作-导航栏

    1、垂直导航栏

    index.html

     1 <!DOCTYPE html>
     2 <html>
     3 <head>
     4 <meta charset="UTF-8">
     5 <title>导航栏</title>
     6      <link href="style9.css" type="text/css" rel="stylesheet">
     7 </head>
     8 <body>
     9      <ul>
    10         <li><a href="#">导航1</a></li>
    11         <li><a href="#">导航2</a></li>
    12         <li><a href="#">导航3</a></li>
    13         <li><a href="#">导航4</a></li>
    14      </ul>
    15 </body>
    16 </html>

    css:

     1 ul{
     2     list-style-type: none;/*去掉前面的实心圆*/
     3     margin:0px;
     4     padding:0px;
     5 }
     6 a:link,a:visited{/*去掉下滑线*/
     7     text-decoration: none;
     8     display:block;
     9     background-color: burlywood;
    10     color:aliceblue;
    11     100px;
    12     text-align: center;
    13 }
    14 a:active,a:hover {/*鼠标放上去的设置*/
    15     background-color: red;
    16 }

    效果:

    2、水平导航栏

    css代码:

     1 ul{
     2     list-style-type: none;/*去掉前面的实心圆*/
     3     margin:0px;
     4     padding:0px;
     5     background-color: burlywood;
     6     460px;
     7     text-align:center;
     8 }
     9 a:link,a:visited{/*去掉下滑线*/
    10     text-decoration: none;
    11     background-color: burlywood;
    12     color:aliceblue;
    13     100px;
    14     text-align: center;
    15 }
    16 a:active,a:hover {/*鼠标放上去的设置*/
    17     background-color: red;
    18 }
    19 li{
    20     display:inline;/*水平摆放*/
    21     padding:3px ;
    22     padding-left:5px;
    23     padding-right:5px;
    24 }
  • 相关阅读:
    SwiftUI:看我展示52张扑克牌,“很快啊!”
    不会吧,这也行?iOS后台锁屏监听摇一摇
    分布式锁
    布隆过滤器原理
    redis缓存穿透
    布隆过滤器应用DEMO
    线程的声明周期
    分布式事务
    滑动窗口协议
    代理
  • 原文地址:https://www.cnblogs.com/UniqueColor/p/5756689.html
Copyright © 2011-2022 走看看