4 ms·
Well, I would say that vertically centering a thumbnail to the left of a block of text would certainly be easier with flex box. My previous solution would have
by deadowl 11y ago
Well, I would say that vertically centering a thumbnail to the left of a block of text would certainly be easier with flex box. My previous solution would have been:
.container { position: relative; }
.thumbnail { position: absolute; margin: auto 0; width: w; height: h; margin: auto 0; top: 0; right: 0; bottom: 0; left: 0; }
.summary { padding-left: w; min-height: h; }
With flexbox that becomes:
.container { display: flex; }
.thumbnail { align-self: center; }
There are a lot fewer traps and design is a lot more scalable in that you don't have to worry per se about width and height.