Creating CSS layouts using harsh language
There is a scene in Aliens 2 where soldiers are about to engage in combat with aggressive alien life-forms only to be told to unload their weapons. Private Frost asks:
What the hell are we supposed to use, man? Harsh language?
Dave Baron’s recent post Overuse of floats considered harmful reminds me of this scene.
“Floats were intended to be used to take small pieces of content out of the flow and let the rest of the text wrap around them. They were not intended to be used for the main content of a page, nor were they designed for it. Nevertheless, use of floats for the main content of a page is quite common today.”
Many web developers today are trying to do the right thing. They try to produce accessible, semantic, valid code and use CSS for presentation. They are also trying to survive in the real world, where there is always compromise between what is ideal and what is achievable.
To leave the main content of the page in normal flow may seem ideal, but it raises other issues for users and developers including lack of control of source order and clearing issues.
My main concern with this sort of article is that it does not offer any real alternatives for developers. To tell developers that they cannot use floats is very similar to taking away ammunition just before battle. There may be valid reasons for avoiding floats, but if there is no solution offered to take its place, where does this leave developers?
I guess I’ll have to start producing CSS layouts using harsh language.