HTML, CSS
To make something like the following images, I wrote a CSS (result).
<div id="ulWrapWrap">
<div id="ulWrap">
<ul>
<li>
<div class="imgWraps"><img src="http://i.imgur.com/QW18s8F.png" alt=""></div>
</li>
<li>
<div class="imgWraps"><img src="http://i.imgur.com/QW18s8F.png" alt=""></div>
</li>
</ul>
</div>
</div>
html, body { height: 100%; }
body { background-color: DodgerBlue; }
#ulWrapWrap { display: table; height: 100%; margin: 0 auto; }
#ulWrapWrap #ulWrap { display: table-cell; max-height: 100%; vertical-align: middle; }
#ulWrapWrap #ulWrap ul { max-width: 90%; max-height: 90%; margin: 0 auto; padding: 10% 20%; background-color: HotPink; }
#ulWrapWrap #ulWrap ul:after { display: block; clear: both; content: ''; }
#ulWrapWrap #ulWrap ul li { float: left; display: table; max-width: 45%; height: 100%; margin-right: 10%; }
#ulWrapWrap #ulWrap ul li:last-child { margin-right: 0; }
#ulWrapWrap #ulWrap ul li .imgWraps { display: table-cell; vertical-align: middle; }
#ulWrapWrap #ulWrap ul li .imgWraps img { max-width: 100%; max-height: 100%; }
Best result
(1) When I resize a window horizontally.
(2) When I resize a window vertically.
Current result
It works well for (1), but doesn't work for (2). How can I make it work? ;)
(1) When I resize a window horizontally.
(2) When I resize a window vertically.
element's width, height to calc(100% - blabla), but I can't come up with an idea. Could you help me, please?
– left click Mar 17 '17 at 13:54