Style textDecoration property
- Forrige side textAlignLast
- Næste side textDecorationColor
- Gå tilbage til forrige niveau HTML DOM Style Object
Definition and usage
textDecoration
Sets or returns one or more text decorations.
Tip:To specify multiple decoration types for an element, list the decoration types separated by spaces.
See also:
CSS Tutorial:CSS tekst
CSS Reference Manual:text-decoration property
Example
Example 1
Set text decoration for the <p> element:
document.getElementById("myP").style.textDecoration = "underline overline";
Example 2
Returns the text decoration of the <p> element:
alert(document.getElementById("myP").style.textDecoration);
Syntax
Returns the textDecoration property:
object.style.textDecoration
Set the textDecoration property:
object.style.textDecoration = "none|underline|overline|line-through|blink|initial|inherit"
Attribute value
Value | Description |
---|---|
none | Defines plain text. Default. |
underline | Defines a line under the text. |
overline | Defines a line over the text. |
line-through | Defines a line through the text. |
initial | Sets this property to its default value. See initial. |
inherit | Inherits this property from its parent element. See inherit. |
Technical details
Default value: | None |
---|---|
Return value: | A string that represents the decoration added to the text. |
CSS version: | CSS1 |
Browser support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Støtte | Støtte | Støtte | Støtte | Støtte |
- Forrige side textAlignLast
- Næste side textDecorationColor
- Gå tilbage til forrige niveau HTML DOM Style Object