I want to believe in XHTML/CSS. I want my structure entirely separate from my layout. But I also think it might all be a big lie, and not because of browser difficulties. Please help clear my misunderstanding. Further explanation - your people call it "more" - is inside.
I'm redesigning an old site as a personal project, so I have no restrictions. I figured I'd take the opportunity to make a truly pure XHTML/CSS creation, no table layout, etc. So I head over to
CSS Zen Garden where I remembered a beautiful demonstration of what could be done with one HTML page and many different style sheets.
Here's where they lost me. When I looked at the example HTML file, I saw this:
<!-- These extra divs/spans may be used as catch-alls to add extra imagery. -->
<!-- Add a background image to each and use width and height to control sizing, place with absolute positioning -->
<!-- There's a rather nasty colour shift bug with transparent GIFs in Netscape 6/7 and Mozilla v1.0 up to v1.3 (in which it's fixed), so make sure to test your work in these browsers. -->
<div id="extraDiv1"><span></span></div><div id="extraDiv2"><span></span></div><div id="extraDiv3"><span></span></div>
<div id="extraDiv4"><span></span></div><div id="extraDiv5"><span></span></div><div id="extraDiv6"><span></span></div>
Ok. They've stuck six extra divs because they may need them to add images in the future. Now, in the programming world, that's what we call a dirty hack. You can't just say "six oughtta do it" and move on. You need a way to incorporate as many images as a future design may require, or else you haven't really separated display from structure. What if my next design needs seven divs to get the job done? Whether that's unlikely or not is besides the point. I'd never declare a static array in code and write a program around "there probably won't be more than X elements...". You just can't do that. It's the definition of sloppy.
Looking at it that way, the idea of a "pure" XHTML/CSS site seems like a farce, since honestly all it seems like CSS is doing is giving us control over how individual HTML tags are styled,
NOT over how a page in general is layed out and designed. CSS Zen Garden does it by using all sorts of strange tricks with DIVs to get the design they want. But I don't see how that's much different than strange tricks with tables, aside from keeping different files. And again, ultimately, if the CSS file can't dictate page layout by itself, structure and style were never truly separated, because you've got style sitting in your structure in the form of those extra DIVs.
I know a lot of very brilliant information architects and web gurus put this stuff together, so I figure I'm the one missing something major, not the other way around. Can someone walk me through this?
posted by y6y6y6 at 4:05 PM on July 15, 2004