u (HTML element)
Example
An example of the deprecated
u element in use (where the em or strong element would have
been more appropriate):
<p>I want one of those remote controls vans. <u>How cool</u> are they?</p>
- Type
- inline element
- Contains
- inline elements only
- Contained by
- block-level elements, inline elements
Description
The u element
(short for underline) simply styles the text contained inside it with a
solid underline, but it offers no semantic meaning about the text
contained. It is, therefore, purely presentational in nature.
Of
all the old presentational HTML elements still available, using the
u element is probably the worst markup crime that you
could commit. Not only is it deprecated - meaning that using it may
invalidate your document (depending on the doctype specified) - but underlining text for
anything other than links is generally considered very bad practice. The
convention is that text inside blocks of copy which is underlined
signifies a link (as in the a element); arbitrarily underling
text, such as headings, will only cause the user to try clicking on it to
no useful end.
In addition to possibly confusing the user into thinking that the underlined text is a link, underlining can also cause readability problems, as the line interferes with the descenders on lower case text (for example the lower case letters g, j, p, q and y), making some word shapes less clear.
The example shown would render as follows:

Use this for…
Text content of any kind.
Compatibility
| IE | 5.5 | Full |
|---|---|---|
| 6.0 | Full | |
| 7.0 | Full | |
| Firefox | 1.0 | Full |
| 1.5 | Full | |
| 2.0 | Full | |
| Safari | 1.3 | Full |
| 2.0 | Full | |
| 3.0 | Full | |
| Opera | 9.2 | Full |
| 9.5 | Full |
As one of the
earliest-used formatting elements, u has full browser
support.
Related Reading
User-contributed notes
There are no comments yet.
Add a note
To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.

