zoukankan      html  css  js  c++  java
  • [纯css下拉菜单]兼容各种IE,但搜狗好像有点问题

    View Code
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <style type="text/css">
    *{margin:0;padding:0;list-style:none;}
    <!--
    body,td,th {
     font-family: Verdana, Geneva, sans-serif;
     font-size: 100%;
     color: #666;
    }
    body {
     background-color: #fff;
     margin: 20px;
    } 
     
    a, a:hover, a:active, a:focus {
     outline:0; 
     direction:ltr;
    }
     
    .wrapper {
     position:relative;height:25px;
    }
     
    .mainmenu {
     position:absolute; left:30%;
     z-index:100;
     font-family:Verdana, Geneva, sans-serif;
     font-weight:normal;
     font-size:90%;
     line-height:25px;
    } 
     
    ul.menu {
     width:100px; 
     overflow:hidden; 
     float:left; 
     margin-right:1px;
    } 
     
    ul.menu a {
     text-decoration:none; 
     color:#fff; 
     padding-left:5px;
    }
     
    ul.menu li.list {
    float:left;
    width:250px;
    margin:-32767px -125px 0px 0px;
    background:red;
    }
     
    ul.menu li.list a.category {
    position:relative;
    z-index:50;
    display:block;
    float:left;
    width:120px;
    margin-top:32767px;
    background:transparent;
    }
     
    ul.menu li.list a.category:hover,
    ul.menu li.list a.category:focus,
    ul.menu li.list a.category:active {
     margin-right:1px;
     background:green;
    }
     
    ul.submenu {
     float:left; 
     padding:25px 0px 0px 0px;  
     background:green;
     background-repeat:no-repeat;
     background-position:left top;
     margin:-25px 0px 0px 0px;
    }
     
    ul.submenu li a {
    float:left;
    width:120px;
    background:#369;
    clear:left;
    }
     
    ul.submenu a:hover,
    ul.submenu a:focus,
    ul.submenu a:active {
    background:#900;
    margin-right:1px;
    }
    -->
     
     
    </style>
    </head>
     <body>
    <div class="wrapper">
    <div class="mainmenu">
    <ul class="menu">
    <li class="list">
     <a class="category" href="#Home">Home</a>
    </li>
    </ul>
    <ul class="menu">
    <li class="list">
     <a class="category" href="#about">About Us&nbsp;&nbsp;&raquo;</a>
     <ul class="submenu">
      <li><a href="#about1">About link 1</a></li>
      <li><a href="#about2">About link 2</a></li>
      <li><a href="#about3">About link 3</a></li>
      <li><a href="#about4">About link 4</a></li>
     </ul>
    </li>
    </ul>
    <ul class="menu">
    <li class="list">
     <a class="category" href="#articles">Articles&nbsp;&nbsp;&raquo;</a>
     <ul class="submenu">
      <li><a href="#articles1">Articles link 1</a></li>
      <li><a href="#articles2">Articles link 2</a></li>
      <li><a href="#articles3">Articles link 3</a></li>
     </ul>
    </li>
    </ul>
    <ul class="menu">
    <li class="list">
     <a class="category" href="#news">News&nbsp;&nbsp;&raquo;</a>
     <ul class="submenu">
      <li><a href="#news1">News link 1</a></li>
      <li><a href="#news2">News link 2</a></li>
     </ul>
    </li>
    </ul>
    <ul class="menu">
    <li class="list">
     <a class="category" href="#donate">Donate</a>
    </li>
    </ul>
    <ul class="menu">
    <li class="list">
     <a class="category" href="#contact">Contact</a>
    </li>
    </ul>
    <!-- end mainmenu --></div>
    <!-- end wrapper --></div>
    </body>


    效果:

  • 相关阅读:
    苹果信息推送服务(Apple Push Notification Service)使用总结
    Xcode 相关路径总结
    微信红包随机算法 OC
    Xcode真机测试could not find developer disk image解决方法
    字典转模型 重写初始化方法
    Xcode 写代码没有补全提示解决:删缓存及显示隐藏文件命令
    按位与、或、异或等运算方法
    OC语言@property @synthesize和id
    iOS开发—Quartz2D简单介绍
    iOS开发—CoreLocation定位服务
  • 原文地址:https://www.cnblogs.com/iz100/p/2691149.html
Copyright © 2011-2022 走看看