麻烦老师批改下,谢谢
来源:2-14 编程练习
一拍
2019-11-20 13:57:50
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
/*此处写代码*/
*{margin:0;padding:0;}
.container{
width:1000px;
height:800px;
}
.top{
width:1000px;
height:500px;
background:#87CEFA;
}
.top div img{
display:inline-block;
width:350px;
height:300px;
margin-left:100px;
margin-top:100px;
float:left;
}
.bottom{
width:1000px;
height:300px;
background:pink;
}
.bottom div img{
display:inline-block;
width:200px;
height:200px;
margin-left:100px;
margin-top:50px;
float:left;
}
</style>
</head>
<body>
<!-- 此处写代码 -->
<div class="container">
<div class="top">
<div><img src="http://climg.mukewang.com/58c0f808000129a303600215.jpg"/></div>
<div><img src="http://climg.mukewang.com/58c0f819000198a703600214.jpg"/></div>
</div>
<div class="bottom">
<div><img src="http://climg.mukewang.com/58c0f81d0001fe4402000060.jpg"/></div>
<div><img src="http://climg.mukewang.com/58c0f8220001dfce02000060.jpg"/></div>
<div><img src="http://climg.mukewang.com/58c0f8780001c74602000060.jpg"/></div>
</div>
</div>
</body>
</html>1回答
好帮手慕码
2019-11-20
同学你好,要求整个盒子在页面中居中显示。建议修改:
通过定位去实现居中:

如果我的回答帮到了你,欢迎采纳,祝学习愉快~
相似问题