这样可以把
来源:4-8 课程总结
慕仔4242357
2017-12-09 23:40:29
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style type="text/css">
body,div,h3,ul,li{
padding: 0;
margin: 0;
}
ul{
list-style-type: none;
width: 100px;
height: 90px;
border: 1px #ffffff solid;
display: none
}
.big{
width: 100px;
border: 1px gray solid;
margin: 0 auto
}
.div1{
width: 100px;
border-bottom: 1px gray solid;
background-color: gainsboro
}
.div2{
width: 100px;
border-bottom: 1px gray solid;
background-color: gainsboro
}
.div3{
width: 100px;
border-bottom: 1px gray solid;
background-color: gainsboro
}
h3{
text-align: center;
line-height: 30px;
}
li{
width: 100px;
height: 30px;
border-right: 1px gray solid;
background-color: #ffffff;
text-align: center;
line-height: 30px
}
.div1:hover ul.elec{
display: block;
height: 90px
}
.div2:hover ul.wash{
display: block;
height: 90px
}
.div3:hover ul.clothes{
display: block;
height: 90px
}
</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回答
可以,如果加上这一个样式的话就更完美了,让鼠标放上去的时候呈现小手状,
div{
cursor: pointer;
}
祝学习愉快!
相似问题