2 ms·
> Wish there was another standard that could co-exist side by side on the web, something simple enough to be implemented reliably by the browser vendors. That
by pcwalton 12y ago
> Wish there was another standard that could co-exist side by side on the web, something simple enough to be implemented reliably by the browser vendors.
That standard exists. It's called flexbox. It was designed to solve exactly this problem (among many others), and does.
That said, as I never tire of mentioning, vertical centering was a part of the design of CSS 2.1. The technique is called "absolute centering". See CSS 2.1 10.6.4 [1]: "If both 'margin-top' and 'margin-bottom' are 'auto', solve the equation under the extra constraint that the two margins get equal values."
[1]: http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-hei...
- angersock 12y agoBut then what happened to it? wtf? do...do they know...how many manhours could've been saved...?
- pcwalton 12y agoYeah, everyone did a really bad job of evangelizing absolute centering back in the day, leading to lots of angry Web developers and awful hacks like the inline-block/vertical-align trick. It should have been the first example given for "position: absolute"…
- AustinG08 12y agoNothing happened to it. It gets used by front-end developers every single day. I personally can't follow the CSS complaints. It is easier to learn than any other front-end dev language in one's toolkit.