Re: Underline element.

You can, but <u> is presentational mark-up, and there shouldn't be 
presentational mark-up in HTML.
Use CSS to achieve the underline as follows:

<p>This is a paragraph and <em>this is emphasised</em></p>

em { text-decoration : underline; }

Or, if the text you wish to underline has no semantic difference to the 
text around it (i.e., is purely decorational) use something like this:

<p>Here is a meaningless corporate <span>style</span></p>

span { text-decoration : underline; }



Regards,
Matt

Ivan Enderlin wrote:
> Hi all :)
>
> I was reading the HTML 5 draft and something is strange about <u> tag.
> In HTML 4, <u> tag is depreciated [1], and <u> tag doesn't exist in 
> HTML 5 [2]. I don't find anymore informations about it in XHTML 1.0 or 
> 1.1. So I deduce that we can't underlined an element in HTML right now ?
>
> Best regards,
> -Ivan
>
> Notes :
>     [1] http://www.w3.org/TR/html4/present/graphics.html#edef-U ;
>     [2] http://www.whatwg.org/specs/web-apps/current-work/#phrase.

Received on Friday, 28 December 2007 17:33:01 UTC