我試圖使用Bootstrap和Flexbox創建一個庫,其中有一個大圖像,旁邊是兩個較小的堆疊圖像,並且兩者都是相同的高度。Boostrap和Flexbox的等高柱高
容器列似乎正在做他們的工作,並保持相同的高度,但我需要列中的img
填充容器的高度。
它適用於Firefox,如果我在img
上使用height: 100%
,但在Chrome和Safari中均可使用。
img {
max-width: 100%;
width: auto\9;
height: auto;
vertical-align: middle;
border: 0;
-ms-interpolation-mode: bicubic;
}
figure {
margin-bottom: 0;
}
.rts-col {
margin-bottom: 30px;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="row">
<div class="rts-col col-8">
<figure>
<img src="http://via.placeholder.com/1400x933">
</figure>
</div>
<div class="rts-col col-4">
<figure style="margin-bottom: 30px;">
<img src="http://via.placeholder.com/1400x933">
</figure>
<figure>
<img src="http://via.placeholder.com/1400x933">
</figure>
</div>
</div>
</div>
這裏的標記和樣式表:https://jsfiddle.net/tylorreimer/q8qe5p80/2/
@Paulie_D我沒有意識到我可以將代碼插入到我的問題上左右。我剛剛更新了我的問題,以包含最小代碼標記。 – tylorreimer