为什么背景色为 f0f0f0 的容器不以我为中心?我给了父元素 text-align: center 的 css 样式,但它似乎忽略了它?
http://codepen.io/ELiHimself/pen/qOXVYJ
<body>
<header></header>
<section class="container">
<div class="box" id="box1">box1</div>
<div class="box" id="box2">box2</div>
<div class="box" id="box3">box3</div>
</section>
</body>
萨斯
*
margin: 0
body
text-align: center
.container
max-width: 1170px
padding-top: 100px
background-color: #f0f0f0
header
height: 100px
background-color: red
.box
padding: 100px
border: 1px solid black
display: inline-block
最佳答案
关于css - 为什么容器不居中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33086733/