Today’s comic features John Allsopp, the trouble with aligning text vertically, and the Outback. No, not the restaurant. The vast arid part of Australia. Mind you, I have in fact been to the restaurant, and I was disappointed for a number of reasons.
At least one of which is the entire lack of kangaroo steaks.
My apologies to the vegetarians among you.
There’s two non-restaurant related points to the comic. The first is that almost everything I know about Australia I learned from Crocodile Dundee. Which means that large knives, boomerangs, and poisonous animals are everywhere. The second (and more relevant) point is that I am more than a little annoyed at the task of vertically aligning text with CSS. And clearly, John agrees with me. But, naturally, when he discusses the point it sounds so much cooler because of that dreamy Australian accent.
Let’s get to it. CSS has been around in some shape or form since, what, 1994? And most of the early web was all about text. Red text. Blue text. Flashing text. Marquee text. Text that was occasionally on fire with a sword going through it. Epic, taste-shatteringly bad text. In the entire intervening generation since, why has nobody in a position to do something about it said, “Hey, if we want to vertically center more than one line of text… how do we do that?”
Really, why? How wild and crazy is the concept that you may want to vertically align a paragraph of something in the mouth of a giant robot, or otherwise arrange it delicately between two slices of bread?
I’m aware that I can center text vertically inside an element that’s been given display: table-cell. And when the need arises, I’ve even used it. But it leaves my mouth tasting almost as bad as it did the day I chewed on a tiny blue plastic donkey I found in the playground when I was five. It’s the kind of rancid, oily taste that ruins your meals for the next several days. No, really. Kids, don’t chew on blue donkeys.
What if I want an inline-block? What if I don’t want all the behaviors of a table-cell? What if I hate tables with such a passion that I’d rather eat my meals while standing rather than bring back memories of table-based layouts with either using a CSS style that imitates them or eating on a wooden surface that shares a name with them? Huh? What then?
Well, in such a circumstance, I believe I’d be screwed.
I’m not entirely sure how necessary it is to have a Marquee module in CSS3. Don’t get me wrong, panning text is… er, hot… but along with all the whiz bang animations that CSS3 brought us, can I please get something that makes me capable of vertically aligning some bloody text in a bloody parent element with a single bloody style? Especially without invoking tables?
Thanks. Loves and kisses.
P.S. John Allsopp is a nutter. I say this, because he’s running a five week online course, HTML5 Live With John Allsopp, over at SitePoint. My evidence for his insanity is that this course contains 8 structured lessons, 2 Live Q&A sessions, practical exercises and a yak! All for under $10. Ok, it doesn’t have a yak. But it has the rest, and looks to be an in depth look at harnessing HTML5 hotness today and tomorrow (markup, native audio and video, canvas, ARIA and more!)
It’s a crazy good bargain. Go take advantage of it.