老师,请检查代码
来源:3-24 编程练习
qq_慕工程8315848
2021-04-20 23:23:49
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Document</title>
<!-- <meta name=""> -->
<style>
#box {
width: 80%;
margin: 0 auto;
background: #ccc;
text-align: center;
}
#box > img {
display: inline-block;
padding: 1.5%;
width: 21%;
height: 200px;
}
/*此处写代码*/
@media (max-width: 960px) {
#box > img {
width: 26.66667%;
}
}
@media (max-width: 780px) {
#box > img {
width: 40%;
}
}
@media (max-width: 440px) {
#box > img {
width: 80%;
}
}
</style>
</head>
<body>
<div id="box">
<img
src="http://img.mukewang.com/climg/5a45e49100014e5010601059.jpg"
alt=""
/>
<img
src="http://img.mukewang.com/climg/5a45e53b00012e6d09940789.jpg"
alt=""
/>
<img
src="http://img.mukewang.com/climg/5a45e53c0001d04e09940732.jpg"
alt=""
/>
<img
src="http://img.mukewang.com/climg/5a45e49100014e5010601059.jpg"
alt=""
/>
<img
src="http://img.mukewang.com/climg/5a45e53b00012e6d09940789.jpg"
alt=""
/>
<img
src="http://img.mukewang.com/climg/5a45e53c0001d04e09940732.jpg"
alt=""
/>
</div>
</body>
</html>
1回答
好帮手慕星星
2021-04-21
同学你好,代码布局以及实现效果很棒。继续加油,祝学习愉快!
相似问题