There is a whole pattern of similar things like this in web that is killing me a little bit every day.
Want to center a div on the page? No worries just wrap it in these 5 divs and apply these 20 css properties and you are good to go. Oh btw, IE doesn't like that, you need this.
Honestly I think we developers should stop putting up with crap like this, and accepting the burden of broken technologies using hacks, etc...
If we become less tolerant of crap, there will be less crap. As long as we accept it by using workarounds, etc... there will be more shitty things to come.
Not the best link, but here's some more recent info: http://css-tricks.com/old-flexbox-and-new-flexbox/
Margin Auto w/ a fixed width
Absolute 50% w/ negative margins
Text-align center parent w/ inline-block display on children
If it was sarcasm, disregard my stupidity.
The whole thing feels like you are stretching something beyond what it was intended to be used for.
Things like element positioning should be so so simple that if you search about it, you get nothing back because no one had a problem to ask for solutions.
Although I must say I'm not mocking CSS in particular, most web technologies feel this way because they were designed many years ago for a web that was supposed to have simple 'documents' like an article, text and paragraphs and today each component of it is expected to do a lot more.
It's not getting all that much better either because each new version and improvement is building on top of the previous decisions, etc...
> most web technologies feel this way
Most technologies you don't know feel this way. And the reason—you don't know them. > It's not getting all that much better either because each
> new version and improvement is building on top of the
> previous decisions
In this case: no.Container has fixed dimensions in my example, but it does not matter in this case.
Btw. your approach is exactly same that we had 10 years ago but with CSS table behavior faking rather than table tag.
Yay. Progress.
It's like variables (yeah I know, LESS / SASS ...).
Yes, totally intuitive and logical solutions all of them.
If you have w3c Stockholm syndrome, that is.
E.g "Just absolute 50% it with a negative margin" (oh, yes, and you would have to know the width beforehand).
>If it was sarcasm, disregard my stupidity.
It's not the stupidity, is the willingness to put up with BS convoluted inelegant workarounds for lack of basic, bread and butter, features.
If you value elegant APIs, KISS and DSLs, you should run screaming in the opposite direction in all those three, horrible, horrible, techniques.
W3C first came up with their (broken) model, and then they kludged solutions to use cases with it, instead of starting from the use cases first. That's why we have had the tables before and the need for the flexbox and grid layout now.
You're right, there is a willingness to put up with it. Mainly because I understand how these solutions work, how to debug them, and make everything nice and peachy. Do I wish things were better? Of course! Who wouldn't?
Text scaling can be a PITA though.
Honestly I think Microsoft has the best developer toolkit in the business right now but they haven't yet had the product design prowess to put that technology in the consumer's hands in any significant numbers.
http://www.w3.org/TR/css3-flexbox/
http://www.html5rocks.com/en/tutorials/flexbox/quick/
If you need IE8+ support, there is also display:table and family.
Apple's JS disables the animation for iOS 4.x and below, so maybe that's why it wasn't playing on your friend's iPod.
I see Apple is really embracing the idea of "the one web" here, introducing web-fragmentation even among their own devices.
Apple has long stopped impressing me. Back in the days when they were the clear underdogs, they were for web-standards and a unified web, because they saw how that was good, and that was what allowed them to become what they are now.
Now it seems they don't really have so much ideological issues with how web-pages should be built anymore. Funny thing that.