The ugly truth is this: almost all CSS/XHTML sites have their own version of tag soup in a combination of extra DIVs, SPANs and BRs used purely for formatting and blocks that have to appear in a certain order for an effect to be applied properly.Anne Van Kesteren has a very good response to this arguement.
There are limitations to what you accomplish with CSS alone; in many cases your XHTML has to submit to minor alterations for styling to be applied the way the designer intended. A true separation of content and presentation would mean you could make your changes purely in the CSS without making changes to the XHTML. Many times, that is not the case.
DIV and SPAN however, have no defined meaning.And as for the second part of his arguement, about the seperation of content and presentation? Again we go back to Anne (because it's early, I don't feel like REALLY writing, and he's already done the work). And Anne points us to Eric Meyer, who stated:
...
In HTML we need these elements for situations where we donít have the right elements to do the job and sometimes we need them to “hack” around browser limitations. You could say that they are useless at that point, but please remember they have no defined meaning (that is very important).
My semantic correction is that we arenít trying to separate presentation and content, but presentation and structure. Doug makes this point throughout the latter part of his post, but I think this is the important thing to state right up front. Without content, itís very difficult to have any presentation, except maybe a blank browser window (very minimalist, but not necessarily useful).The comment thread at Anne's site has some wonderful thoughts in it as well.
Tagged As CSS
Comments are Open (3)
Posted at 07:42 AM
Comments
Alex
You're missing (and misrepresenting) the point of my post. My claim is simply that we have not yet achieved a 100% clean break of presentation and content with XHTML and CSS. There is still code being used for presentation in the XHTML.
Posted by: Alex | March 22, 2004 10:59 AM
Tony
I don't mean to misrepresent you. And I certainly don't mean to cast you in a bad light.
I think you raised some very good questions. And some good points. I was just feeling very lazy this morning, and used the content of others (you, Anne and Liorean) to represent what I was feeling.
However, I don't think you'll be able to fully seperate presentation from content/structure until XML and XSLT is fully realized. Which might be a while.
Let's look at a simple CSS class. Call it foobar.
<p class='foobar'>
That's is completely correct. And it's tied to the content. Inheriently. It has to be.
Same for span, divs (see Anne's response for those reasons), and even in-line markup such as strong, em, etc. Those are presentational items.
But I do agree with you that people will continue to muck up the standards. Always going to happen. Hell, I do it from time to time.
It boils down to expectations. "How do I get this done quickly and out the door?" Sure, it might be ugly, but _it's good enough_. I hate that, but I've had to fall back upon that in the past, because I needed to.
Posted by: Tony | March 22, 2004 11:08 AM
Alex
I'm not even advocating 100% separation of content and presentation. XHTML isn't pure data IMO, I think it's ok to have some presentation code in there.
I often hear people tout separation of presentation and data as a reason to use CSS - I don't agree that it accomplishes that. I also don't think that it should, but I didn't make any claims either way about that point.
Posted by: Alex | March 22, 2004 06:02 PM