3
爲什麼flex中心伸展我的形象,而不是集中它?CSS3 flex - 拉伸圖像而不是居中?
CSS:
.flex-centre {
display: flex;
justify-content: center;
flex-direction: column;
text-align: center;
height: 100%;
width: 100%;
}
HTML:
<div style="height: 400px; width: 400px; background: #ccc">
<div class="flex-centre">
<img class="img-responsive" src="http://placekitten.com/g/200/200" alt="">
</div>
</div>
結果:
任何想法?