如何使得6个内容居中显示?
如何将红色container区域里的东西(6个)居中显示?
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
*{margin:0px;
padding:0px
}
.container{
width:1200px;
margin:0px auto;
border:1px red solid;
}
.container .one .t1{float: left; margin:0px 20px 20px 20px;border:1px solid gray;}
.container .one .t2{float: left;margin:0px 20px 20px 20px;border:1px solid gray;}
.container .one .t3{float: left;margin:0px 20px 20px 20px;border:1px solid gray;}
.container .two .t1{float: left; margin:0px 20px 20px 20px;border:1px solid gray;}
.container .two .t2{float: left;margin:0px 20px 20px 20px;border:1px solid gray;}
.container .two .t3{float: left;margin:0px 20px 20px 20px;border:1px solid gray;}
.clear{clear:both;}
p{padding-left:10px}
.one{padding: 20px 20px 5px 20px;}
.two{padding: 0px 20px 10px 20px;}
</style>
</head>
<body>
<div class="container">
<div class="one">
<div class="t1">
<img src="//img1.sycdn.imooc.com\/climg/590fe9770001e63102400135.jpg">
<p>welcome to mooc!</p>
</div>
<div class="t2">
<img src=http://img1.sycdn.imooc.com\/climg/590fe97d00011bda02400135.jpg>
<p>welcome to mooc!</p>
</div>
<div class="t3">
<img src=http://img1.sycdn.imooc.com\/climg/590fe982000150ba02400135.jpg>
<p>welcome to mooc!</p>
</div>
<div class="clear"></div>
</div>
<div class="two">
<div class="t1">
<img src="http://img1.sycdn.imooc.com\/climg/590fe9770001e63102400135.jpg">
<p>welcome to mooc!</p>
</div>
<div class="t2">
<img src=http://img1.sycdn.imooc.com\/climg/590fe97d00011bda02400135.jpg>
<p>welcome to mooc!</p>
</div>
<div class="t3">
<img src=http://img1.sycdn.imooc.com\/climg/590fe982000150ba02400135.jpg>
<p>welcome to mooc!</p>
</div>
<div class="clear"></div>
</div>
</div>
</body>
</html>
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星