Whenever anybody says that CSS is easy, or "of course you can do that with CSS", or even hints that CSS is somehow well-designed... ...the only thing I really need to say, is that every couple months, on Hacker News, where a lot of really smart people hang out, a new top-voted story comes up about how to center a div . With tons of comments and discussion too. And it's not even a joke. What more is there to say?
CSS has two faces, the awesome "You can make amazing things with ease" face and the "It won't do what I want unless I create some cludgy arrangement of elements in order to attach a combination of weird properties" Those two faces are because of two simple facts. 1. CSS is a really good way to set properties. 2. The properties are shit. The part of the properties that is most gloriously broken for layout is that the…
#div[center-x] == #container[center-x];
(note that this is fully source order independent. It doesn't matter where in DOM the elements #div and #container are)