I find myself quite irritated with CSS lately, because I have been trying to be a good modern web-boy and style this place with CSS.
The problem with CSS is what it leaves out. Take a very simple example: this blog. Like many blogs, I want a two-column layout: blog entries on the left, a small sidebar about the blog on the right.
No problem in CSS: use two <div>s, set a width: or a min-width:, and
then set one <div> as
float: left; or so. And this works, as long as
neither column overflows. Unfortunately, a) I am guaranteed to someday
write a blog entry with a long unbreakable line, since I am going to
quote code periodically and b) the user can make their browser window
pretty darn narrow.
What I want to happen in this situation is for CSS to shrug and enlarge the whole thing so that the user has to scroll sideways to see the entire page. What I can get is one of:
- the over-long line is truncated and is undisplayable.
- the thing containing the over-long line is truncated but grows a scrollbar, so at least I can theoretically read it.
- the over-long line scribbles itself all over the sidebar.
- my sidebar stops being a sidebar and suddenly becomes a top-bar or a bottom-bar.
No, blech, ptui, and 'ha, you jest' respectively.
Those evil bad table things that we aren't supposed to use for layout? Surprise. They get this right.
So if you look at the HTML source for the blog, you will see a giant table.
(Now, perhaps there is some magic way to do this in CSS that actually works right and that no one mentions or uses. If so, please tell me about it. I would like to use CSS if I can.)