Don't we love CSS? it's so easy to do both complex things like 3D animations but also simple things like position something centered horizontally or vertically by just saying align:center, oh, sorry, it's margin: 0 auto, right, no? it's left:50% with a relative inside an absolute div, or was that an absolute div inside a relative span? ok so doing it vertically is really easy, it's valign:middle, oh, wait, I'm confus…
Well put rant. 16 years after CSS was released unto the world, and it still lacks a decent way to center content. Makes me lose all faith in the W3C.
#container {
display: flex;
width: 1000px;
height: 1000px;
background: gray;
}
#centered {
margin: auto;
width: 500px;
height: 500px;
background: red;
}
Of course, we’re waiting on implementations to catch up with the spec: http://caniuse.com/#feat=flexbox . That’s not really the W3’s fault though.