仿淘宝导航下拉菜单效果

Original 2019-03-24 23:20:59 257
abstract:<!DOCTYPE html><html><head><meta charset="GB2312"><title>仿淘宝首页导航条按钮布局效果</title><style> body{ font-size:12px; text-align:center;  margin-to

<!DOCTYPE html>

<html>

<head>

<meta charset="GB2312">

<title>仿淘宝首页导航条按钮布局效果</title>

<style> 


body{ font-size:12px; text-align:center;  margin-top:30px; font-family:Verdana;} 

div,img{margin:0; padding:0; border:0;} 

ul,li{list-style-type: none; margin:0; padding:0; float:left; } 

#info{ margin-left:auto; margin-right:auto;width:760px; text-align:left;} 

#new{ margin-top:-12px;position: absolute;margin-left:-12px;} 

#nav{ height:30px; width:610px; margin-left:auto; margin-right:auto;} 

#nav li{margin-left:1px; height:30px;} 

#nav li a{ display:block;float:left; text-decoration:none; background-image: url(/upfile/2009925/2009925215122914.GIF);background-repeat: no-repeat; display:block; background-position:left top;} 

#nav a span{cursor:hand; color:#000;background-image: url(/upfile/2009925/2009925215122388.GIF);background-repeat: no-repeat; display:block;background-position: right top; padding:7px 10px 6px 10px; float:left; } 

#nav li a:active,#nav li a:hover {margin-top:0px; } 

#nav li  a:active span,#nav li a:hover span {padding:10px 10px 6px 10px; margin-top:0px; display:block; color:#FFF;} 

#01 a:link,#01 a:visited {background-position: 0px -27px;} 

#01 a:link span,#01 a:visited span{background-position:right -27px;padding:10px 10px 6px 10px; margin-top:0; color:#FFF; font-weight:bold;} 

#02 a,#03 a,#04 a,#05 a,#06 a,#07 a,#08 a,#09 a,#10 a,#11 a{margin-top:3px;} 

#02 a:active,#02 a:hover {background-position: 0px -57px;} 

#02 a:active span,#02 a:hover span{background-position:right -57px;} 

#03 a:active,#03 a:hover {background-position: 0px -87px;} 

#03 a:active span,#03 a:hover span{background-position:right -87px;} 

#04 a:active,#04 a:hover {background-position: 0px -117px;} 

#04 a:active span,#04 a:hover span{background-position:right -117px;} 

#05 a:active,#05 a:hover {background-position: 0px -147px;} 

#05 a:active span,#05 a:hover span{background-position:right -147px;} 

#06 a:active,#06 a:hover {background-position: 0px -177px;} 

#06 a:active span,#06 a:hover span{background-position:right -177px;} 

#07 a:active,#07 a:hover {background-position: 0px -207px;} 

#07 a:active span,#07 a:hover span{background-position:right -207px;} 

#08 a:active,#08 a:hover {background-position: 0px -237px;} 

#08 a:active span,#08 a:hover span{background-position:right -237px;} 

#09 a:active,#09 a:hover {background-position: 0px -267px;} 

#09 a:active span,#09 a:hover span{background-position:right -267px;} 

#10 a:active,#10 a:hover {background-position: 0px -297px;} 

#10 a:active span,#10 a:hover span{background-position:right -297px;} 

#11 a:link span,#11 a:visited span{color:#FF6600;} 

#11 a:active,#11 a:hover {background-position: 0px -327px;} 

#11 a:active span,#11 a:hover span{background-position:right -327px;} 

#menu{ width:760px; height:26px; background:#FF9900;} 

#r1{border-top: 0px;border-bottom: 0px; border-left:3px solid #fff;border-right:3px solid #fff; height:1px; overflow:hidden;} 

#r2{border-top: 0px;border-bottom: 0px; border-left:2px solid #fff;border-right:2px solid #fff; height:1px; overflow:hidden;} 

#r3{border-top: 0px;border-bottom: 0px;    border-left:1px solid #fff;border-right:1px solid #fff; height:1px; overflow:hidden;} 

</style>

</head>


<p align="center"><body>


<p align="center"><div id="info">

 <div id="nav">

  <ul>

   <li id="01"><a href="http://www.baidu.cn"><span>首页</span></a></li>

   <li id="02"><a href="http://www.baidu.com"><span>数码通讯</span></a></li>

   <li id="03"><a href="http://www.baidu.com"><span>女人</span></a></li>

   <li id="04"><a href="http://www.baidu.com"><span>男人</span></a></li>

   <li id="05"><a href="http://www.baidu.com"><span>家居</span></a></li>

   <li id="06"><a href="http://www.baidu.com"><span>书籍音像</span></a></li>

   <li id="07"><a href="http://www.baidu.com"><span>运动</span></a></li>

   <li id="08"><a href="http://www.baidu.com"><span>游戏</span></a></li>

   <li id="09"><a href="http://www.baidu.com"><span>宠物</span></a></li>

   <li id="10"><a href="http://www.baidu.com"><span>香港街</span></a></li>

   <li id="11"><a href="http://www.baidu.com"><span>淘宝商城</span></a></li>

   <li>

   <div id="new">

    <img src="/upfile/2009925/2009925215124708.GIF" alt="新加栏目" /></div>

   </li>

  </ul>

 </div>

 <div id="menu">

  <div id="r1">

  </div>

  <div id="r2">

  </div>

  <div id="r3">

  </div>

  <div>

  </div>

 </div>

</div>



<p align="center"></body>


<p align="center"></html>


<p align="center"><br><br><hr> 互联网兴趣与学习交流向高手学习代码有好处!</font></p>


Correcting teacher:天蓬老师Correction time:2019-03-25 09:31:53
Teacher's summary:<meta charset="GB2312">, 以后不要再用这个编码集了, 以防止 以后与数据库的数据结合出现问题

Release Notes

Popular Entries