未引入js,出现多一个盒子?请检查代码
来源:3-3 表示层--图片区域
Golden几何
2020-09-12 17:40:20
<!DOCTYPE html>
<html>
<head>
<title>全屏的云南旅游相册</title>
<meta charset="UTF-8"/>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<span></span>
<nav>
<a href="#">泸沽湖</a>
<a href="#">丽江古城</a>
<a href="#">茶马古道</a>
<a href="#">就这家·云逸客栈</a>
<a href="#">西双版纳</a>
<a href="#">云南红酒庄</a>
<a href="#">轿子雪山</a>
<a href="#">普者黑</a>
<a href="#">海埂大坝</a>
<a href="#">玉龙湾</a>
<a href="#">昆明郊野公园</a>
<a href="#">欧洲风琴小镇</a>
</nav>
<div>
<img src="img/1.jpg" alt=""/>
<img src="img/2.jpg" alt=""/>
<img src="img/3.jpg" alt=""/>
<img src="img/4.jpg" alt=""/>
<img src="img/5.jpg" alt=""/>
<img src="img/6.jpg" alt=""/>
<img src="img/7.jpg" alt=""/>
<img src="img/8.jpg" alt=""/>
<img src="img/9.jpg" alt=""/>
<img src="img/10.jpg" alt=""/>
<img src="img/11.jpg" alt=""/>
<img src="img/12.jpg" alt=""/>
</div>
</body>
</html>
*{
margin:0;
padding:0;
border:none;
}
html,
body{
overflow:hidden;
height:100%;
background:#93b3c6;
}
span{
display:block;
width:16px;
height:16px;
border-radius:50%;
margin:30px auto 40px;
background:#fff;
}
nav{
display:flex;
width:78.125vw;
margin:0 auto 45px;
justify-content:space-between;
position:relative;
}
/*因为是before,在a之前*/
nav:before{
content:'';
position:absolute;
top:10px;
width:100%;
height:10px;
background:#fff;
/* display:block;*/
}
/*设置absolute,无法撑开文字*/
nav a{
position:relative;
font-size:12px;
padding:5px;
border:2px solid #5395b4;
color:#255d7e;
text-decoration:none;
background:#fff;
}
/*(8,1,3,.3)*/
div{
position:relative;
overflow:hidden;
width:78.125vw;
height:75vh;
margin:0 auto;
background:#fff;
box-shadow:0 0 0 rgba(8,1,3,0.3);
}
div img{
position:absolute;
top:0;
right:0;
bottom:0;
left:0;
margin:auto;
width:98%;
height:96%;
}
1回答
同学你好,老师这边测试同学的代码,没有出现多一个div这样的情况,如下:
同学重新测试一下哦。祝学习愉快~
相似问题