|
-
Oct 22nd, 2002, 11:05 AM
#1
Thread Starter
Black Cat
Interesting: W3.org says not to use DIV and SPAN for CSS
From http://www.w3.org/TR/REC-CSS2/selector.html
Note. CSS gives so much power to the "class" attribute, that authors could conceivably design their own "document language" based on elements with almost no associated presentation (such as DIV and SPAN in HTML) and assigning style information through the "class" attribute. Authors should avoid this practice since the structural elements of a document language often have recognized and accepted meanings and author-defined classes may not.
So they are pretty much recommended not to do CSS by making a bunch of DIVs and SPANs and applying CSS class or id styles to them, but to stick with the standard HTML tags when possible, as those have established meanings.
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Oct 22nd, 2002, 11:17 AM
#2
Fanatic Member
I agree with that in most cases, but occasionally it's so much easy to use multiple embedded divs and css with attached css than it easy to use the HTML presentation tags.
This is a minor example but when I designing an XHTML 1.1 page, for our intranet, I wanted to use <BLOCKQUOTE> for displaying certain text. But, with this, I wanted to change font-size of a line of text embedded within so I opted for <SPAN STYLE="font-size:10pt;">. But, when I ran the page through the W3C Validator It told me the span wasn't allowed there. In the end I had to use a Div with embedded Spans which passed.
In theory though, I agree with what they are saying, and in the vast majority of cases it should be agreed too.
-
Oct 23rd, 2002, 05:18 AM
#3
Frenzied Member
I think they just mean that you should only use DIV and SPAN when the enclosed markup has no stuctural meaning, e.g. use P for paragraphs instead of DIVs, acronym for acronyms etc. But the W3C don't follow their own rules anyway - look at their home page, they're using tables for layout
-
Oct 23rd, 2002, 05:53 AM
#4
Fanatic Member
Yeah, good point. To me it still seems like the are saying that all presentation markup shouldn't be replaced with css.
Yeah, I noticed the tables layout a while ago. Once CSS 3 is functional in all major browsers they'll have to changes... they've got no excuse then
-
Oct 23rd, 2002, 10:26 AM
#5
Frenzied Member
Yep probably. Any idea of a rough date when CSS 3 is going to be finished? Mozilla already supports most of the working draft anyway doesn' it?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|