Re: class attribute deprecated with <span>?

At 21:02 7-2-03, Chris Lilley wrote:
>Sso> by O'Reilly. It says that it is deprecated to use style,
>class and id attributes with the <span> tag.
>
>Sso> Is this really deprecated?
>..... I see no evidence that this is true and it would see
>most odd if so.

This is very odd indeed. perhaps the author of the book doesn't
quite get the difference between 'deprecated' and 'discouraged to
do when the recommendation provides other means to get to the
same result in a standardized manner'

The style attribute is NOT (yet) deprecated but it's better
practice to use the <link> element for most situations (if not
all) And this holds not only for <span> but is general.

The class attribute is NOT deprecated and will never be. Its the
fundamental thing (especially for HTML 4.01) to provide the layer
to get from tags and elements to applying (a from of) semantics
above the basics the recommendation provides (and to bind style.)
Like providing deeper meaning to a paragraph like summary text
and the main text. Or by having not only just images, but by
having charts, icons, graphs, drawings, and photographs in your
document. Or in combination with <span> and <div> to provide
custom semantic rich elements that are not provided by the specification. 
Like having a <span class="soundslike"> or a
<div "catalogentry">.

And last for the id attribute which is NOT deprecated. Every
element has an id attribute. It distinguishes the element from
the others (applying an order of them.) The id attribute is
most valuable for DOM level access to the elements from i.e. JavaScript. 
For instance to be able to the paragraph P1 or
to get to input Inp3. For applying style less recommendable to
use the id attribute. This because the value of the id attribute
has to be unique. Only in some situations using to id attribute
to apply style would be correct (I currently cannot come up
with s valid one.)

Its clear (at least by my opinion) that O'Reilly needs to publish
an errata to correct this (most fundamental) mistake. The author
of the book might rethink if this is the result of putting
something different on paper than you mean, or if he is knowing
too little of the subject he is writing about? (This is not
meant against either O'Reilly or the author, but something
everybody has to ask him/her self all the time)

Christian

Received on Saturday, 8 February 2003 17:06:26 UTC