• 简单的css二级下拉菜单


    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>经典CSS二级下拉菜单</title>
    <style type="text/css">
    <!--
    *{margin:0;padding:0;border:0;}
    body {
    font-size:12px;
    }
    #nav {
      line-height: 24px;  list-style-type: none; background:#666;
    }
    #nav a {
     display: block; 80px; text-align:center;
    }

    #nav li {
     float: left; 80px; background:#CCC;
    }

    #nav li ul {
     line-height: 27px;  list-style-type: none;text-align:left;
     left: -999em; 180px; position: absolute;
    }
    #nav li ul li{
     float: left; 180px;
     background: #F6F6F6;
    }
    #nav li ul a{
     display: block; 178px; 156px;text-align:left;padding-left:24px;
    }
    #nav li ul a:link  {
     color:#666; text-decoration:none;
    }
    #nav li ul a:visited  {
     color:#666;text-decoration:none;
    }
    #nav li ul a:hover  {
     color:#F3F3F3;text-decoration:none;font-weight:normal;
     background:#C00;
    }
    #nav li:hover ul {
     left: auto;
    }
    #nav li.sfhover ul {
     left: auto;
    }
    #content {
     clear: left;
    }
    -->
    </style>
    <script type=text/javascript>
    function menuFix() {
     var sfEls = document.getElementById("nav").getElementsByTagName("li");
     
     for (var i=0; i<sfEls.length; i++) {
      sfEls[i].onmouseover=function() {
      this.className+=(this.className.length>0? " ": "") + "sfhover";
      }
      sfEls[i].onMouseDown=function() {
      this.className+=(this.className.length>0? " ": "") + "sfhover";
      }
      sfEls[i].onMouseUp=function() {
      this.className+=(this.className.length>0? " ": "") + "sfhover";
      }
      sfEls[i].onmouseout=function() {
      this.className=this.className.replace(new RegExp("( ?|^)sfhover\b"),
    "");
      }
     }
    }
    window.onload=menuFix;
    //--><!]]></script>
    </head>
    <body>
    <ul id="nav">
    <li><a href="/">网站相关</a>
     <ul>
     <li><a href="/other/top100.shtml">最新下载</a></li>
     <li><a href="/other/top100.shtml">下载排行</a></li>
     <li><a href="/other/lastupdate.shtml">最新更新</a></li>
     </ul>
    </li>

    </ul>
    </body>

  • 相关阅读:
    cqyz oj | 单峰排列
    cqyz oj/uva 548 | 二叉树
    cqyz oj | 树网的核 | 树的直径
    cqyz oj | 树上的询问 | 最近公共祖先
    cqyz oj | 循环逆序对 | 逆序对 | 树状数组
    cqyz oj | 潜水比赛 | 贪心
    YOLO v3 & Pascal VOC数据集
    太阳爆发分类
    PPT制作
    anaconda
  • 原文地址:https://www.cnblogs.com/cwl168/p/3768092.html
Copyright © 2020-2023  润新知