In short span of 2–3 days, I encountered two different examples of people writing that all this CSS–for–layout thing is nonsense. Too hard. Inadequate. Buggy and inconsistent. Just plain hard.
Well, it is. Hard, I mean.
Everyone knows how to build some shelter: put some stools and cover with branches and it would mostly fit the bill. If however it should withstand the wind and rain, it requires quite a bit more skills. Everyone knows how to get heating: put some wood and start a fire. Only few knows what it takes to build proper, natural heating that’s just there.
The same is with web development. Anyone can build a web page that looks fine to them. But it might not be fine to me or some other people. It might be downright inaccessible to some. It might be pain in the ass to some other.
Every single time I encounter rants like those two linked above, it’s plainly obvious it’s made by people who just don’t get it. I mean, just look at those two rants/posts (whatever you call them) and you’ll see how not-getting-it is the core of their frustration.
Just one example:
On the screen the natural order of flow for the five major layout elements is: top, left, center, right, bottom. But the actual order in which they appear in the code has “right” and “center” reversed. Is this a mistake? To find out, let’s see what happens if we change them around so that the order in the code matches the presentation order:
…
Youch! That looks terrible! Apparently the order matters. The reason that the order matters is that this layout, like all multi-column CSS layouts, is achieved with floats, and the way that floats get rendered depends on the order in which they appear. So we have not managed to separate content from presentation.
Yes Ron, it does not look good because CSS rules were written to achieve the desired layout using the given HTML structure code — which could also be much improved, but that’s another topic.
To give you real-life example: do you have a bike? Do you expect to be able to drive if you sit on it faced to the rear of the bike? Hm, crap, I can’t turn the pedals properly. The bike is shit.
The other rant is even worse, the anger of not being able to code the desired layout in CSS is spilling from all corners. I can understand that frustration and have experienced it several times, when I tried to learn something and failed to do so.
I drank the Kool-Aid, and I woke up two weeks later with a broken design. I had a headache from banging my head against the CSS wall. But, it simply couldn’t be a problem with CSS itself. The problem had to be that I didn’t understand CSS well enough. The answer had to be that I was bad, lazy or I didn’t care about web standards or something. The internets had told me so.
Yes iamelgringo, you’re just not up to it. You should have admitted it to yourself and hired someone else who is, to finish the job. Or just use tables as you did and get on with your life. Posting this:
So, I don’t ever want to read how web designers who don’t use pure CSS in their layouts are lazy, stupid, don’t care about their craft, backwards or don’t bathe properly. Never again. People who post such things online are heretofore to be known as CSS Trolls and are to be banished from the internets for all time. Begone yea vile fiends!
just makes you jealous wanker.
And just to touch lightly on the argument about Google – the fact that Google is not using CSS-based design is responsible for the fact that they have two different search pages – one for desktops, another for mobile devices (when I think about it, they probably have more than two). Multiple code bases for the page that has one input field and two buttons on it. Sheeeesh…Google’s front page is prime example of crapy front-end work.
Will code HTML for food. And give you crap code for it.
Or however that joke went. There are many reasons why tables are not to be used for layout. Two important ones are:
- tables are fixed structure which cement the layout for good
- cemented structures are impossible or way too hard to adapt to displays with vastly different screen estate
For instance, take a look at my winery web site. If you look at it on desktop browser, you’ll see rich graphics, 3-column web site. But if you look at it on iPhone in portrait mode, you’ll see one-column website with some graphics removed. All it took to achieve this look is one meta element in the page head and half a screen of additional CSS rules. It would be just as simple to adapt it to other mobile browsers. Let me see you do that this quick and fast with tables.
Not to mention how impossible is to achieve noticeably different skins if you use layout tables. For the last several years I have maintained old and created new instances of company’s main web product, using the very same code base, with just a different set of CSS rules and images. 20 or so counting, each new instance was several days at worst for the complete reskin job.
Every time I need to apply some designs to pages created using ASP.NET, I cringe and resign my case or dig deep and redo almost entire contents of the .aspx files. It takes good deal of knowledge to do things properly.
Not everyone are capable of doing it, which is just fine. There’s plenty of other professions, not everyone should be web front-end developers. If you don’t know how to do it and/or are incapable of learning, just give up and find some other thing to do in life.
Don’t go around prophesying nonsense.





Yes!! Thank you for seeing and saying what was needed. Your analogies are spot on, and your examples very helpful in understanding the pro’s of CSS-based layout.
Well done :)
Funny thing is that this site looks like a$$ in Google chrome because the div’s used don’t fill the background color all the way to the next line.
If you would’ve used tables, you wouldn’t have that problem and your site would look better…
Just perfect! Thanks a lot
Jason, you’re wrong. The site looks (almost) the same in FF, Chrome, Opera, whatever.
You may not like the design, but it’s due to my graphical design decisions — nothing to do with layout techniques.
More about the correct use of tables here:
http://developer.cmzmedia.com/?p=71
Aleksandar, in your post, you urge iamelgringo to hire someone better suited for this profession. You overlook a possibility that iamelgringo is himself hired by someone else and coaxed into building a set of pages at an extremely short notice. In this situation, does one go by “The Right Way” or does one stick to the safety provided by table alignment?
Not all websites are made the way we’d like: Easy to modify with flexible layout. Too many of them are made just as the boss wanted. And that layout sticks pretty much forever.
I don’t say you are wrong. I love CSS too and use it heavily for my own web pages, but I don’t think going to tables is a bad way if I am stuck with a task that has other important things (say server side logic or a javascript module) pending decisions.
My issue with his post is not that he eventually used tables, but that he wrote the post lambasting CSS best practices. I wrote:
Hi Aleksander!
An avid CSS evangelist myself, I agree with one notion you criticized: putting a layout into columns while maintaining a semantically significant order in the html source is problematic.
For instance, if I want to make my html source behave nicely for people using screen readers, I wouldn’t want the site menu listed ahead of the page article… but switching them around when using a 3-column layout with a footer has sent me crawling up the wall more than once.
Apart from that, I agree with your article, and whole-heartedly support the continued effort to separate layout from content. I myself recently applied media queries to the home page of my web site to omit some graphics when the browser screen narrows down. Works like a charm in all modern browsers.
Your wine site looks lie this to me:
text
text
text
text
text
text
text
text
text
text
And so on.
It is very hard to read.
Christopher, what browser would that be..?
Great Post, whenever I hear people complain about CSS-based layouts I just start to hear “blah blah I don’t know what I’m doing blah blah;
Your winery page is a horrible abomination. Of course it looks good — You used absolute widths! Now imagine when your client goes and writes a long word or puts a big picture on it or something; BAM, instant failure.
The whole idea behind CSS is to separate content from presentation. So why is it that you define your divs’ widths by the (estimated, I might add) size of their contents? What happens when a browser scales the font up but not the divs?
Now let’s have a look how your winery site looks like when we resize the browser down a bit…:
http://corexii.com/winerycss.gif
Oh dear. I’m not an industry veteran but I’m pretty sure we don’t want our text on top of other text… Makes it kinda hard to read, you know?
And these problems could’ve been avoided with a table layout. Looks like you’re the incompetent one here.
Ed. note: last comment approved for pure fun. :)