麻烦老师看下怎么可以使图片与图片的距离就等同于图片与盒子的左右边距?
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
*{padding: 0;margin:0;}
.container{
width: 1000px;
height: 850px;
margin: 0 auto;
position: absolute;
top: 50%;
left: 50%;
margin-top: -425px;
margin-left: -500px;
}
.top{
width: 1000px;
height:600px;
background-color: lightskyblue;
}
.bottom{
width: 1000px;
height: 250px;
background-color: pink;
}
.top img{
width: 455px;
height: 560px;
margin: 20px 20px;
}
.bottom img{
width: 250px;
height:200px;
margin:25px 40px;
}
</style>
</head>
<body>
<div class="container">
<div class="top">
<img src="http://img1.sycdn.imooc.com/climg//58c0f808000129a303600215.jpg">
<img src="http://img1.sycdn.imooc.com/climg//58c0f819000198a703600214.jpg">
</div>
<div class="bottom">
<img src="http://img1.sycdn.imooc.com/climg//58c0f81d0001fe4402000060.jpg">
<img src="http://img1.sycdn.imooc.com/climg//58c0f8220001dfce02000060.jpg">
<img src="http://img1.sycdn.imooc.com/climg//58c0f8780001c74602000060.jpg">
</div>
</div>
</body>
</html>
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星