abstrait:<!DOCTYPE html><html><head> <title>三級菜單demo</title> <meta charset="utf-8"> <script type="text/javascript" src="../jquery-3.4.0.min.js&qu
<!DOCTYPE html>
<html>
<head>
<title>三級菜單demo</title>
<meta charset="utf-8">
<script type="text/javascript" src="../jquery-3.4.0.min.js"></script>
<script >
$(document).ready(function(){
$('.twobox').hide()
$('.therebox').hide()
$('.one>li').mouseover(function(){
$(this).find('.twobox').slideDown(600)
})
$('.one>li').mouseleave(function(){
$(this).find('.twobox').slideUp(200)
})
$('.two').mouseover(function(){
$(this).find('.therebox').slideDown(500)
})
$('.two').mouseleave(function(){
$(this).find('.therebox').slideUp(300)
})
})
</script>
<style type="text/css">
*{margin:0;padding: 0;}
ul{list-style: none;}
.menu .one>li{color: #F2F2F2;float: left;line-height: 40px;padding:0 20px;border-right: 1px solid #ccc}
.menu{width: 550px;height: 40px;background: #000;margin: 10px auto 0;}
.twobox{background: #2B2628; position: absolute;left: 0 ;right: 0;text-align: center;}
.twobox li:hover{background: #000;color: orange}
.therebox{position: absolute;background:#2B2628;top: 0 ;left:110px}
.therebox li{height: 40px;width:110.84px;text-align: center;color: #fff}
</style>
</head>
<body>
<div class="menu">
<ul class="one">
<li style="margin-left: 10px">游戲資料</li>
<li style="position: relative;">商場/合作
<ul class="twobox">
<li>網吧特權</li>
<li class="two" style="position: relative;">點劵充值
<ul class="therebox">
<li>QQ充值</li>
<li>微信充值</li>
<li>點劵充值</li>
</ul>
</li>
<li class="two" style="position: relative;">電競小說
<ul class="therebox">
<li>小說1</li>
<li>小說2</li>
<li>小說3</li>
<li>小說4</li>
</ul>
</li>
<li>聯(lián)系我們</li>
</ul>
</li>
<li>社區(qū)互動</li>
<li>賽事官網</li>
<li style="border: none;">自助系統(tǒng)</li>
</ul>
</div>
</body>
</html>
到瀏覽器中的效果
Professeur correcteur:天蓬老師Temps de correction:2019-04-28 09:14:13
Résumé du professeur:昨天看一個學員, 問用純CSS來實現(xiàn)三級下拉菜單 , 其實用JS來實現(xiàn)才是王道