Summary
The HTML Underline Element (<u>
) renders text with an underline, a line under the baseline of its content.
In HTML5, this element represents a span of text with an unarticulated, though explicitly rendered, non-textual annotation, such as labeling the text as being a proper name in Chinese text (a Chinese proper name mark), or labeling the text as being misspelled.
Usage context
Content categories | Flow content, phrasing content, palpable content. |
---|---|
Permitted content | Phrasing content. |
Tag omission | {{no_tag_omission}} |
Permitted parent elements | Any element that accepts phrasing content. |
DOM interface | {{domxref("HTMLElement")}} Up to Gecko 1.9.2 (Firefox 4) inclusive, Firefox implements the {{domxref("HTMLSpanElement")}} interface for this element. |
Attributes
This element only includes the global attributes.
Tips and Notes
Tip: Avoid using the {{ HTMLElement("u") }} element where it could be confused for a hyperlink.
Note: The HTML 5 specification reminds developers that other elements are almost always more appropriate than {{ HTMLElement("u") }}.
DOM interface
This element implements the HTMLElement
interface.
Example
<u>Today's Special</u>: Salmon<br /> <span style="text-decoration:underline;">Today's Special</span>: Salmon
Today's Special: Salmon
Today's Special: Salmon
<p><u>All</u> of that is explained in <u>Dive into Python</u></p>
All of that is explained in Dive into Python.
should instead be
<p><em>All</em> of that is explained in <cite>Dive into Python</cite></p>
All of that is explained in Dive into Python.
CSS can be used to style those elements exactly the same, however.
See Also
- The {{ HTMLElement("span") }}, {{ HTMLElement("i") }}, {{ HTMLElement("em") }}, and {{ HTMLElement("cite") }} elements are, depending on the case, to be used instead.
- The CSS {{ cssxref("text-decoration") }} property is to be used to achieve the former visual aspect of the {{ HTMLElement("u") }} element.
{{ languages({"ja":"ja/HTML/Element/u","en":"en/HTML/Element/u"}) }}