老师,为什么我设置了display :none; display:block;没有效果?
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
*{
margin:0;
padding:0;
}
.back{
background: url(http://img1.sycdn.imooc.com/climg//59c9f7ce0001839219034033.png) no-repeat center top;
width:100%;
height:4043px;
}
.nav{
width:160px;
height:205px;
position:fixed;
top:50%;
left:0;
margin-top:-103px;
font-family:"微软雅黑";
}
.tit{
width:160px;
height:40px;
}
.nav-li :hover ul{
display: block;
}
.nav-li{
width:160px;
height:auto ;
border-bottom:1px solid #fff;
background:#333;
text-align:center;
line-height:40px;
color:#FFF;
font-size:16px;
cursor:pointer;
}
.nav-li ul{
width:160px;
height:auto;
background:#fff;
display:none;
}
.nav ul li{
width: 160px;
height: 40px;
border-bottom: #666 dashed ;
color: #333;
line-height:40px;
}
</style>
</head>
<body>
<div class="back">
<div class="nav">
<div class="nav-li">
<div class="tit">慕课网的标题</div>
<ul>
<li>
二级栏目
</li>
<li>
二级栏目
</li>
<li>
二级栏目
</li>
</ul>
</div>
<div class="nav-li">
<div class="tit">慕课网的标题</div>
<ul>
<li>
二级栏目
</li>
<li>
二级栏目
</li>
<li>
二级栏目
</li>
</ul>
</div>
<div class="nav-li">
<div class="tit">慕课网的标题</div>
<ul>
<li>
二级栏目
</li>
<li>
二级栏目
</li>
<li>
二级栏目
</li>
</ul>
</div>
</div>
</div>
</body>
</html>10
收起
正在回答 回答被采纳积分+1
相似问题
登录后可查看更多问答,登录/注册
前端小白入门系列课程
- 参与学习 人
- 提交作业 11218 份
- 解答问题 36712 个
从一个不会编程的小白到一个老司机是需要过程的,首先得入门,学习基础知识,然后才能进阶,最后再到精通,本专题是你走进前端世界的不二选择!
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星