上一题的代码,请老师帮忙看看指点下。
来源:4-8 课程总结
慕函数0272456
2017-12-20 10:05:38
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>display属性</title>
<style type="text/css">
/*样式补充*/
*{
padding: 0px;
margin: 0px;
}
.big{
width:100px;
text-align: center;
border: 1px solid #e5e5e5;
}
ul li{
list-style: none;
}
h3{
background:#eee;
}
.wash,.elec,.clothes{
display: none;
}
.div1:hover .elec{
display: block;
font-weight: bold;
}
.div2:hover .wash{
display: block;
font-weight: bold;
}
.div3:hover .clothes{
display: block;
font-weight: bold;
}
</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>1回答
好帮手慕糖
2017-12-20
你好,整体的效果实现不错,还有点建议:1、可以给h3添加下边框哦。2、三个鼠标移入事件,可优化下,例:
.big div:hover ul{
display: block;
}祝学习愉快~
相似问题
回答 5
回答 3