Hacker News new | ask | show | jobs
by experimental- 4125 days ago
Vertical centering has been relatively easy since CSS 2.1 (Table model); flexbox of course offers much more than that. Flexbox may be finalized and unchangeable, if only because so many browsers already support it unprefixed (as support for such properties is almost never removed) – however, like much of the CSS3, flexible box model is not yet a W3C Recommendation, and is, in theory at least, subject to change. With proper tools, a prefix here and there is not a huge burden.

The reason why many browsers rush to unprefix CSS3 is not that it's perfect, but because of the lazy web developers who only prefix stuff for WebKit. This may or may not bite the community in the future.

3 comments

Who is just prefixing stuff for Webkit? Mixin libraries have been pretty standard for at least three years, and now Autoprefixer is starting to do the heavy lifting.

People only initially prefixed for Webkit because webkit was the only browser that had a lot of these properties. The problem was that nobody went back and updated their prefixes, which really only further illustrates one of the big problems with the whole idea of vendor prefixes.

> Vertical centering has been relatively easy since CSS 2.1 (Table model)

But not with divs which are more common

It's not hard, really: just use absolute centering [1]. That's actually what "margin: auto" is there for in CSS 2.1; it's a shame they were bad at evangelizing it.

[1]: http://codepen.io/shshaw/full/gEiDt

…so you use table display rules on the divs?
using display: table-cell; is a hack and has quite a few gotchas. However it was a very useful hack none-the-less for a feature which most designers would never expect would be such a challenge.