<span>

J

JohnWMpls

I have been happily using the span tag with css class and style attributes
for quite a while but I just noticed that it is deprecated.

Is the div tag the one to use instead?

JohnW-Mpls
 
D

Dylan Parry

Using a pointed stick and some pebbles, JohnWMpls scraped this into the
dirt:
I have been happily using the span tag with css class and style attributes
for quite a while but I just noticed that it is deprecated.

Where have you read that? It is completely false.
 
D

David Dorward

JohnWMpls said:
I have been happily using the span tag with css class and style attributes
for quite a while but I just noticed that it is deprecated.

It isn't deprecated. Its a last resort after you fail to find an element
that has better semantics for your purpose, but it isn't deprecated.
Is the div tag the one to use instead?

Div is just the block version of span.
 
J

JohnWMpls

=>Using a pointed stick and some pebbles, JohnWMpls scraped this into the
=>dirt:
=>> I have been happily using the span tag with css class and style attributes
=>> for quite a while but I just noticed that it is deprecated.
=>
=>Where have you read that? It is completely false.

In O'Reilly - "HTML & XHTML The Definitive Guide", 5th edition. It is
mentioned as deprecated in the descripiton for the span tag but not in the
usual spot - the title for that tag's section. I suspect an editing
error.

Plus, I would hate to lose Span - very handy for doing something special
with a word or phrase in a sentence.

I also like <u>, the underline tag, which is deprecated. The <u> is so
much simpler than the css text-decoration for random uses on a page.

JohnW-Mpls
 
M

Mark Parnell

Previously in alt.html said:
I have been happily using the span tag

*Element*. It's a span *element*.
with css class and style attributes
for quite a while but I just noticed that it is deprecated.

No it's not. As David said, it should always be a last resort, but it
certainly isn't deprecated (and is unlikely ever to be, IMHO).
Is the div tag the one to use instead?

If you want a block-level element instead of inline, and you can't find
a more suitable one, then yes.
 
M

Mark Parnell

Previously in alt.html said:
In O'Reilly - "HTML & XHTML The Definitive Guide", 5th edition.

Hmmm. They're generally pretty reliable (note: hearsay, never looked
myself).
It is
mentioned as deprecated in the descripiton for the span tag
*element*

but not in the
usual spot - the title for that tag's
*element's*

section. I suspect an editing
error.

You're sure it's not talking about a particular attribute or something?
It *is* definitely talking about the span element? Not trying to insult
your intelligence, but I don't understand how something like that could
have slipped past both the authors and editors.
I also like <u>, the underline tag,

which is deprecated. The <u> is so
much simpler than the css text-decoration for random uses on a page.

It doesn't carry any semantic meaning though (at least, not in any
context I'm aware of), unlike <b> and <i>, which can.
 
S

Spartanicus

Mark Parnell said:
It doesn't carry any semantic meaning though (at least, not in any
context I'm aware of), unlike <b> and <i>, which can.

The 4.01 spec doesn't assign semantic meaning to <b> and <i>, it
designates them as "Font style elements".
 
D

David Dorward

JohnWMpls said:
I also like <u>, the underline tag, which is deprecated. The <u> is so
much simpler than the css text-decoration for random uses on a page.

Random uses of underline are usually a really bad idea, underline shouts
"I'm a link! Click me!" to users.
 
A

Andy Dingley

In O'Reilly - "HTML & XHTML The Definitive Guide", 5th edition.

Throw the book away. It's years since I saw an O'Reilly that was worth
reading.

It's also not "The Definitive Guide". That's the W3C TR, which is
publically available for free. There are also books by Raggett(s), who
have better claim to be "definitive"
It is mentioned as deprecated in the descripiton for the span tag

Then that's just plain wrong (not unusual in recent O'Reillys)
 
A

Andy Dingley

It doesn't carry any semantic meaning though (at least, not in any
context I'm aware of),

Underline does carry a semantic meaning on the web -- established common
usage means that underline strongly implies a link. As any attempt to
use <u> or CSS as a decorative underline conflicts with this, it's just
a bad idea to use underlines at all (outside links).

There's also a long established principle in typography (read Sumner
Stone's "The Design Of Books" - any web designer will benefit from this)
that underline is "Emphasis by typewriters who can't do any better
method". Underline is basically ugly and if you have better techniques,
use them.
 
A

Andy Dingley

it should always be a last resort,

Or an early resort, if you're interested in semantically annotated HTML
(with the use of class) without affecting visible presentation by
default.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,084
Latest member
HansGeorgi

Latest Threads

Top