老师,我写的效果对不对
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<title>Document</title>
<style>
#box{
width:80%;
margin:0 auto;
background: #ccc;
text-align:center;
font-size: 0;
}
#box>img{
display: inline-block;
padding:1.5%;
height:200px;
}
/*此处写代码*/
#box>img {
width: 97%;
}
@media (min-width: 440px) {
#box>img {
width: 47%;
}
}
@media (min-width:780px) {
#box>img {
width: 30.3333333333%;
}
}
@media (min-width: 960px) {
#box>img {
width: 22%;
}
}
</style>
</head>
<body>
<div id="box">
<img src="http://img1.sycdn.imooc.com//climg/5a45e49100014e5010601059.jpg" alt="">
<img src="http://img1.sycdn.imooc.com//climg/5a45e53b00012e6d09940789.jpg" alt="">
<img src="http://img1.sycdn.imooc.com//climg/5a45e53c0001d04e09940732.jpg" alt="">
<img src="http://img1.sycdn.imooc.com//climg/5a45e49100014e5010601059.jpg" alt="">
<img src="http://img1.sycdn.imooc.com//climg/5a45e53b00012e6d09940789.jpg" alt="">
<img src="http://img1.sycdn.imooc.com//climg/5a45e53c0001d04e09940732.jpg" alt="">
</div>
</body>
</html>
正在回答
同学你好,代码正确,很棒,祝学习愉快!
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星