Skip to: content, navigation

by Ian Lloyd

u (HTML element)

Spec
Depr. Empty Version
Yes No HTML 2
Browser support full matrix
IE5.5+ FF1+ Saf1.3+ Op9.2+
Full Full Full Full

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:

Example of b element

Use this for…

Text content of any kind.

Compatibility

IE5.5Full
6.0Full
7.0Full
Firefox1.0Full
1.5Full
2.0Full
Safari1.3Full
2.0Full
3.0Full
Opera9.2Full
9.5Full

As one of the earliest-used formatting elements, u has full browser support.

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.

Related Products

The Principles of Beautiful Web Design

Best Seller!

You don’t need to go to Art School to design great looking web sites!

Book Cover: The Principles of Beautiful Web Design

Download the FREE sample chapters