SubscribeHonestly, in most HTML/table based sites with a good CMS, the structure and presentation are already separatedThis was JWZ's complaint when he tried his hand at CSS. Here's the thing: it's separated at the back-end, but it is not separated as the rest of the web sees it. So in terms of, say, search engines extracting useful information, non-semantic markup puts them at a disadvantage. The way those pages live on the web is significant.
<div>s in the Zen Garden XHTML file are pretty specific to the Zen Garden's design. It's not a hack; it's Dave Shea trying to give hundreds of designers as much freedom as possible when working with a single, static XHTML file. You'd never have this situation on a site in which the design team actually had access to the XHTML.#left, #right { width: 200px; }
#content { width: 100% - 400px; }.background-image: does not suffice), or surround an existing element with multiple <div/>s to give it a multi-colored border.You can't specify that elements should be adjacent, or otherwise have their properties be dependant on one another.Really? What about selectors like "blockquote>p", "div#content *", or "h1+h2"? Those give you descendant and adjacent elements (although there is no reverse-adjacent, which could be handy.
For example, it would be nice to be able to add images all over the page (background-image: does not suffice)You could do this using Z-indexes and absolutely-placed images.
adamrice: What about selectors like "blockquote>p", "div#content *", or "h1+h2"?I mean, you can't say "this block should be adjacent to that block" ... the ability for which tables are still in use.
You could do this using Z-indexes and absolutely-placed images.Yes, but then the images must be elements on the page. Some images are part of the content and are okay as elements. Others are purely presentational, like fancy borders or rounded corners. These should be in the presentation layer, but
background-image: is usually not good enough.You are not logged in, either login or create an account to post comments
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 tirade at 3:58 PM on July 15, 2004