我挣扎水平居中在我的容器一些内容:内容居中水平使用Flexbox的
https://jsfiddle.net/y56t31q9/6/
.container {
display: flex;
flex-direction: column;
width: 600px;
background-color: blue;
justify-content: center;
/* Not centering content horizontally? */
}
.item {
max-width: 500px;
height: 100px;
background-color: yellow;
border: 2px solid red;
}
<div class="container">
<div class="item"></div>
<section class="item"></section>
<section class="item"></section>
<footer class="item"></footer>
</div>
我还以为证明内容将有完成了这个伎俩,但无济于事。
任何帮助将不胜感激 谢谢!
可能的重复:http://stackoverflow.com/q/32551291/3597276 –