谁有CSS二级下拉菜单,保证能用的!要兼容IE7 IE6 FF
谢谢了。急用。兄弟们帮帮!
谁有CSS二级下拉菜单,保证能用的!要兼容IE7 IE6 FF
谢谢了。急用。兄弟们帮帮!
http://www.abaonet.com/jsCode/nav/200908/1902.html
这有一个是用CSS制作的二级下拉菜单,兼容各个主流浏览器,你看看。
与其在这让别人提供你不如去经典论坛去寻找吧 估计不久你也会做了啊
<!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" lang="zh-CN"> <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-family: arial, 宋体, serif; font-size:12px; } #contain{ margin:0px auto; width:1003px; background:#CCCCCC; position:relative;} #nav { line-height: 24px; list-style-type: none; background:#666; } #nav a { display: block; width: 80px; text-align:center; } #nav a:link { color:#666; text-decoration:none; } #nav a:visited { color:#666;text-decoration:none; } #nav a:hover { color:#FFF;text-decoration:none;font-weight:bold; } #nav li { float: left; width: 80px; background:#CCC; } #nav li a:hover{ background:#999; } #nav li ul { line-height: 27px; list-style-type: none;text-align:left; left: -999em; width: 980px; position: absolute; float:left; } #nav li ul li{ float: left; width: 80px; background: #F6F6F6; } #nav li ul a{ display: block; width: 80px;text-align:center; } #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 { margin-left:0px; } #nav li.sfhover ul { left: 0; } #content { clear: left; } --> </style> <script type=text/javascript><!--//--><![CDATA[//><!-- 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> <div id="contain"> <ul id="nav"> <li><a href="#">菜单一级</a> <ul> <li><a href="#">菜单一级</a></li> <li><a href="#">菜单一级</a></li> <li><a href="#">菜单一级</a></li> <li><a href="#">菜单一级</a></li> <li><a href="#">菜单一级</a></li> <li><a href="#">菜单一级</a></li> </ul> </li> <li><a href="#">菜单二级</a> <ul> <li><a href="#">菜单二级</a></li> <li><a href="#">菜单二级</a></li> <li><a href="#">菜单二级</a></li> <li><a href="#">菜单二级服</a></li> <li><a href="#">菜单二级</a></li> <li><a href="#">菜单二级</a></li> </ul> </li> <li><a href="#">菜单三级</a> <ul> <li><a href="#">菜单三级</a></li> <li><a href="#">菜单三级</a></li> <li><a href="#">菜单三级</a></li> <li><a href="#">菜单三级</a></li> </ul> </li> <li><a href="#">菜单四级</a> <ul> <li><a href="#">菜单四级</a></li> <li><a href="#">菜单四级</a></li> <li><a href="#">菜单四级</a></li> <li><a href="#">菜单四级</a></li> <li><a href="#">菜单四级</a></li> </ul> </li> </ul> </div> </body> </html>
自己测试吧
IE8跟FF无措