16.3.1 Underlining, overlining, striking, and blinking: the 'text-decoration' property
- 'text-decoration'
-
Value: none | [ underline || overline || line-through || blink ] | inherit Initial: none Applies to: all elements Inherited: no (see prose) Percentages: N/A Media: visual
This property describes decorations that are added to the text of an element. If the property is specified for a block-level element, it affects all inline-level descendants of the element. If it is specified for (or affects) an inline-level element, it affects all boxes generated by the element. If the element has no content or no text content (e.g., the IMG element in HTML), user agents must ignore this property.
Values have the following meanings:
- none
- Produces no text decoration.
- underline
- Each line of text is underlined.
- overline
- Each line of text has a line above it.
- line-through
- Each line of text has a line through the middle
- blink
- Text blinks (alternates between visible and invisible). Conforming user agents are not required to support this value.
The color(s) required for the text decoration should be derived from the 'color' property value.
This property is not inherited, but descendant boxes of a block box should be formatted with the same decoration (e.g., they should all be underlined). The color of decorations should remain the same even if descendant elements have different 'color' values.
In the following example for HTML, the text content of all A elements acting as hyperlinks will be underlined:
A[href] { text-decoration: underline }