抱歉老师代码粘错了,以下是正确的:
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>display属性</title>
<style type="text/css">
/*样式补充*/
body,div,h3,ul,li{margin:0px;padding:0px; font-family:"微软雅黑";}
.big{width:150px; background-color:#d9dde1;text-align:center;margin:0px auto;}
.div1{border:1px #919394 solid;padding:10px 0px 0px ;border-bottom:none;}
.div2{border:1px #919394 solid;padding:10px 0px 0px;border-bottom:none;}
.div3{border:1px #919394 solid;padding:10px 0px 0px;}
li{list-style-type:none;background-color:#fff;padding:10px;}
ul{display:none;}
.div1:hover .elec{display:block;}
.div2:hover .wash{display:block;}
.div3:hover .clothes{display:block;}
</style>
</head>
<body>
<div class="big">
<div class="div1">
<h3>家电</h3>
<ul class="elec">
<li>冰箱</li>
<li>洗衣机</li>
<li>空调</li>
</ul>
</div>
<div class="div2">
<h3>洗护</h3>
<ul class="wash">
<li>洗衣液</li>
<li>消毒液</li>
<li>柔顺剂</li>
</ul>
</div>
<div class="div3">
<h3>衣物</h3>
<ul class="clothes">
<li>衬衫</li>
<li>裤子</li>
<li>卫衣</li>
</ul>
</div>
</div>
</body>
</html>
2018-01-18 10:12:39
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星