W3C home > Mailing lists > Public > www-style@w3.org > July 1999

Re: <U> Deprecated

From: John Whelan <whelan@itp.unibe.ch>
Date: Tue, 20 Jul 1999 08:27:07 -0400 (EDT)
Message-id: <199907201226.OAA18564@itpserver>
To: davids@nwi.net, Steven.Pemberton@cwi.nl
Cc: www-style@w3.org
> The idea behind using style sheets is to separate content from
> presentation. So don't ask yourself "how do I underline?", first ask
> "what am I trying to represent?".
> 
> If the answer is "defining instances of a word" then code your HTML
> like this:
> 
> 	A <span class="define">programmer</span> is a device for
> 	turning coffee into programs.
> 
> If you are underlining a sentence because it is important, classify it 
> that way:
> 
> 	<span class="important">Don't mention the war!</span>
> 
> and so on.

Each of these examples would be better handled by using HTML tags
which carry the *meaning* of what you're trying to describe and then
using stylesheets to customize the appearance if you like:

	A <dfn class="underlined">programmer</dfn> is ...

	<em class="underlined">Don't mention the war!</em>

with the stylesheet declaration

	.underlined {text-decoration: underline; font-style: normal}

> By the way, some people prefer to use <strong> or <em> instead of
> <span> since the words then still show up differently on CSS
> deficient browsers.

Or because this allows the content information to be retained in the
HTML.  Marking up all phrase elements with <span> doesn't separate
content from style, it just transfers them both to the stylesheet.
Where HTML provides phrase elements that carry meaning, it's
preferable to use those rather than relying on people reading the
class names attached to your <span>s.  For instance, a robot
extracting all the defining instances of terms would have a much
easier time picking out the <dfn> elements than guessing how many
variants of "def" "defn" "definition" etc are possible class names.

					John T. Whelan
					whelan@iname.com
					http://www.slack.net/~whelan/

      ------------------------------------------------
          only 38 days until the Swiss premiere of
         Star Wars Episode I: "The Phantom Menace"!
                Thank you for not spoiling.
Received on Tuesday, 20 July 1999 13:47:35 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:53:59 GMT