标签:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>导航</title> <style type="text/css"> body{padding: 0px;font-size: 10px;behavior:url(CSS/csshover.htc);} .topmenu{display: block; width: 220px;border: 2px solid #e4393c;margin: 0px;padding: 0px;} .toptitle{height: 40px;line-height: 40px;text-align: left;font-size: 11px;font-weight: bold;background-color: #e4393c;color: white;padding-left: 20px;} .topmenu li{list-style: none;height: 30px;line-height: 30px;font-size: 11px;text-align: left;padding-left: 8px;z-index: 3;background-image: url(image/2.png);background-repeat: no-repeat;background-position: right;} .topmenu li a{text-decoration: none;color: #313131;} .topmenu li:hover{background-image: none;border: 1px solid #DDD;border-right:0px;box-shadow: 0 0 8px #DDD;-moz-box-shadow:0 0 8px #DDD;-webkit-box-shadow:0 0 8px #DDD;} .topmenu li a:hover{text-decoration: underline;font-weight: bold;color: #e4393c;} .submenu{display: none; width:715px;left: 220px;position: absolute;top: 40px;z-index: 4;border: 1px solid #DDD;background: white;box-shadow: 0 0 8px #DDD;-moz-box-shadow:0 0 8px #DDD;-webkit-box-shadow: 0 0 8px #DDD;} .leftdiv{float: left;width: 490px;margin: 5px;} .rightdiv{float: left;width: 200px;margin: 5px;} .topmenu li:hover .submenu{display: block;} .topmenu li:hover span{background-color: white;display: inline-block;z-index: 20;width: 20px;height: 30px;float: right;position: relative;} .leftdiv dl{display: block;border-bottom: 1px solid #EEE;padding-bottom: 6px;overflow: hidden;} .leftdiv dl dt{display: block;float: left;width: 60px;text-align: right;height: 22px;line-height: 22px;padding-right: 6px;} .leftdiv dl dt a{color: #e4393c;text-decoration: underline;font-size: 10px;font-weight: bold;} .leftdiv dl dd{display: block;overflow: hidden;} .leftdiv dl dd a{display: block;float: left;border-left: 1px solid #CCC;padding:0 8px;font-size: 9px;color: #737373;height: 14px;line-height: 14px;margin: 4px;} .rightdiv dl dd{margin: 3px 0;} .rightdiv dl dt{color: #e4393c;font-weight: bold;font-size: 10px;} .rightdiv dl dd a{font-size: 9px;color: #e4393c;line-height: 22px;} .rightdiv dl dd a:hover{color: #737373;font-weight: normal;} </style> </head> <body> <ul class="topmenu"> <div class="toptitle">全部商品分类</div> <li><a href="#">图书</a><span></span> <div class="submenu"> <div class="leftdiv"> <dl> <dt><a href="#">电子书</a></dt> <dd> <a href="#">免费</a> <a href="#">小说</a> <a href="#">励志与成功</a> <a href="#">婚恋/两性</a> <a href="#">文学</a> <a href="#">经管</a> <a href="#">畅读VIP</a> </dd> </dl> <dl> <dt><a href="#">数字音乐</a></dt> <dd> <a href="#">通俗流行</a> <a href="#">古典音乐</a> <a href="#">摇滚说唱</a> <a href="#">爵士蓝调</a> <a href="#">乡村民谣</a> <a href="#">有声读物</a> </dd> </dl> <dl> <dt><a href="#">音像</a></dt> <dd> <a href="#">音乐</a> <a href="#">影视</a> <a href="#">教育音像</a> <a href="#">游戏</a> </dd> </dl> <dl> <dt><a href="#">文艺</a></dt> <dd> <a href="#">小说</a> <a href="#">文学</a> <a href="#">青春文学</a> <a href="#">传记</a> <a href="#">艺术</a> </dd> </dl> <dl> <dt><a href="#">人文社科</a></dt> <dd> <a href="#">历史</a> <a href="#">心理学</a> <a href="#">政治/军事</a> <a href="#">国学/古籍</a> <a href="#">哲学/宗教</a> <a href="#">社会科学</a> </dd> </dl> <dl> <dt><a href="#">经管励志</a></dt> <dd> <a href="#">经济</a> <a href="#">金融与投资</a> <a href="#">管理</a> <a href="#">励志与成功</a> </dd> </dl> <dl class="fore7"> <dt><a href="#">生活</a></dt> <dd> <a href="#">家教与育儿</a> <a href="#">旅游/地图</a> <a href="#">烹饪/美食</a> <a href="#">时尚/美妆</a> <a href="#">家居</a> <a href="#">婚恋与两性</a> <a href="#">娱乐/休闲</a> <a href="#">健身与保健</a> <a href="#">动漫/幽默</a> <a href="#">体育/运动</a> </dd> </dl> <dl> <dt><a href="#">科技</a></dt> <dd> <a href="#">科普</a> <a href="#">IT</a> <a href="#">建筑</a> <a href="#">医学</a> <a href="#"> 工业技术</a> <a href="#">电子/通信</a> <a href="#">农林</a> <a href="#">科学与自然</a> </dd> </dl> <dl> <dt><a href="#">少儿</a></dt> <dd> <a href="#">少儿</a> <a href="#">0-2岁</a> <a href="#">3-6岁</a> <a href="#">7-10岁</a> <a href="#">11-14岁</a> </dd> </dl> <dl> <dt><a href="#">教育</a></dt> <dd> <a href="#">教材</a> <a href="#">中小学教辅</a> <a href="#">考试</a> <a href="#">外语学习</a> </dd> </dl> <dl> <dt><a href="#">其它</a></dt> <dd> <a href="#">英文原版书</a> <a href="#">港台图书</a> <a href="#">工具书</a> <a href="#">套装书</a> <a href="#">杂志/期刊</a> </dd> </dl> </div> <div class="rightdiv"> <dl> <dd> <a href="http://sale.jd.com/act/1XDZ6ShE5M7tTrl.html"> <img src="http://img30.360buyimg.com/erpVCAare/g16/M00/0B/1B/rBEbRlOCFcoIAAAAAAArMNB2tlkAACTlwDgVG8AACtI514.jpg" width="194" height="70" title="\家电"> </a> </dd> <dd> <a href="http://sale.jd.com/act/v8kJIaPmsMGuebpH.html"> <img src="http://img30.360buyimg.com/erpVCAare/g16/M00/0B/19/rBEbRlOAiHUIAAAAAAAx8X2c6oIAACTCAP56A4AADIJ112.jpg" width="194" height="70" title="小家电--三请聚宝盆"> </a> </dd> </dl> <dl> <dt>推荐品牌</dt> <dd> <a href="#">美的官方旗舰店</a> </dd> <dd> <a href="#">苏泊尔旗舰店</a> </dd> <dd> <a href="#">九阳旗舰店</a> </dd> <dd> <a href="#">东菱旗舰店</a> </dd> <dd> <a href="#">海尔统帅旗舰店</a> </dd> <dd> <a href="#">小熊旗舰店</a> </dd> </dl> </div> </div> </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> <li><a href="#">哦哦哦哦哦</a></li> <li><a href="#">啦啦啦啦啦</a></li> <li><a href="#">水水水水水水</a></li> </ul> </body> </html>
还有一种JS方法:将上述的li:hover改为.lihover 然后再添加以下代码即可:
<script type="text/javascript">
window.onload=function(){
var oli=document.getElementsByTagName(‘li‘);
for(var i=0;i<oli.length;i++){
oli[i].onmouseover=function(){
this.className="lihover";
}
oli[i].onmouseout=function(){
this.className="";
}
}
}
</script>
标签:
原文地址:http://www.cnblogs.com/td-tkzc/p/5803990.html