我正在做一個佈局,我無法弄清楚如何讓這些列的高度相等,特別是文字環繞時的綠色區域。你能幫我嗎? 等高度柱 - 柔性盒和柔性包裝:包裝
我的HTML模板,更.category的容器內...
<div class="flex-container">
<div class="category-container">
<a href="#" class="img-gallery-col medium-internal-page-static-image" style="background-image: url('http://placehold.it/800/800');">
</a>
<h4 class="text-center">Salads & Sides</h4>
</div>
</div>
我對柔性容器的CSS是...
.flex-container {
width: 100%;
display: flex;
flex-wrap: wrap;
align-items: flex-start;
}
這裏是如果分類編號鏈接這有助於http://codepen.io/johnsonjpj/pen/evopaV?editors=1100
編輯:我已經更新了筆,並添加了他ight到類別容器,並使其顯示:flex。然後我加入了flex-grow到h4。我怎樣才能在綠色區域內垂直居中?
好吧,我已經更新了我的筆。 http://codepen.io/johnsonjpj/pen/evopaV?editors=1100現在有辦法在綠色區域垂直對齊文本嗎? –
http://codepen.io/anon/pen/jBRWeK?editors=1100 –
感謝您的幫助,我現在明白了:) –