1 回答

TA貢獻(xiàn)11條經(jīng)驗 獲得超9個贊
你要的是這種效果嗎,給你個例子,沒用js的
<!DOCTYPE html>
<html>
<head>
<title></title>
<style type="text/css">
*{
margin:0;
padding: 0;
}
header{
padding-top: 50px;
padding-left: 300px;
}
ul li{
width: 150px;
height: 35px;
float: left;
list-style: none;
line-height: 35px;
font-weight: bold;
}
ul li:hover{
background: gray;
}
ol{
display: none;
}
ul li:hover>ol{
display: block;
}
</style>
</head>
<body>
<header>
<ul>
<li>手機(jī)
<ol>
<li>蘋果</li>
<li>三星</li>
<li>華為</li>
<li>oppo</li>
</ol>
</li>
<li>手表
<ol>
<li>勞力士</li>
<li>天梭</li>
<li>老皮匠</li>
<li>雷歐</li>
</ol>
</li>
<li>電腦
<ol>
<li>蘋果</li>
<li>華碩</li>
<li>戴爾</li>
<li>聯(lián)想</li>
</ol>
</li>
<li>男裝
<ol>
<li>阿瑪尼</li>
<li>阿迪</li>
<li>李寧</li>
<li>七匹狼</li>
</ol>
</li>
</ul>
</header>
</body>
</html>