我掙扎水平居中在我的容器一些內容:內容居中水平使用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 –