Skeleton と Normalize css を使用しています。div コンテナー内で 2 つの画像を縦横に並べて中央揃えにしたいと考えています。ページが狭くなってきたら、以下のように1枚目の画像の下に2枚目の画像が欲しい
Normal width:
img1 img2
Narrow view:
img1
img2
これが私のコードです:
<div id="center">
<div class="left">
<img class="u-max-full-width" src="img1.jpg">
</div>
<div class="right">
<img class="u-max-full-width" src="img2.jpg">
</div>
</div>
そして、ここに私のcssがあります:
#center {
width: 100%;
text-align: center;
position: relative;
display: table;
}
#center > div {
display: table-cell;
vertical-align: middle;
}
.left {
width: 50%;
height: 100%;
text-align: center;
}
.right {
width: 50%;
height: 100%;
text-align: center;
}
このコードでは、通常の幅で垂直方向に中央揃えされますが、狭いビューでは画像を互いに下に揃えることができません。これを行う方法についてのアイデアはありますか?