3 ms·
proof that css is still broken in 2016
by orliesaurus 11y ago
proof that css is still broken in 2016
- roneesh 11y agoAs I said above in a post, in my opinion Flexbox is win, it's an attempt to create a logically consistent tool for layout, vs the comparative hackery of combining float/position/display/margin to achieve your desired layout. Is it perfect? I doubt that, but it's definitely a step towards CSS being less broken.
- deadowl 11y agoWell, 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.