<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<style>
*{
margin: 0;padding: 0;
}
.box{
width: 440px;
height: 298px;
border: 1px solid black;
margin: 100px auto;
}
.nav li{
list-style: none;
width: 110px;
height: 50px;
background-color:orange;
float: left;
text-align: center;
line-height: 50px;
}
.nav .current{
background-color: #cccccc;
}
.content{
list-style: none;
display: none;
}
.content img{
width: 440px;
height: 248px;
}
.content .show{
display: block;
}
</style>
</head>
<body>
<div class="box">
<ul class="nav">
<li class="current">h5+c3</p>
<p>jQuery</p>
<p>c语言</p>
<p>Go语言</p>
</ul>
<ul class="content">
<li class="show"><img src="img/1.jpg" alt=""></p>
<p><img src="img/1.jpg" alt=""></p>
<p><img src="//i02piccdn.sogoucdn.com/6115accfff85498f" alt=""></p>
<p><img src="//i02piccdn.sogoucdn.com/6115accfff85498f" alt=""></p>
</ul>
</div>
</body>
</html>问题:第二个ul通过class选择器设置为none,然后我想默认显示第一张img,通过给li添加class选择器设置display为block,但是却没有显示 求解
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/4547/viewspace-3123836/ ,如需转载,请注明出处,否则将追究法律责任。