YouTip LogoYouTip

Prop Style Textdecorationline

# Style textDecorationLine Property [![Image 8: Style Object Reference](#) Style Object](#) ## Example Display a line above the paragraph: document.getElementById("myP").style.textDecorationLine="overline"; [Try it Yourself Β»](#) * * * ## Definition and Usage The textDecorationLine property sets or returns the type of line to use for text decoration. **Note:** You can also use the textDecoration property to set textDecorationLine. The textDecoration property is a shorthand property for textDecorationLine, textDecorationStyle, and textDecorationColor. **Note:** You can also use multiple values at the same time, like underline _and_ overline, to display lines both above and below the text. * * * ## Browser Support ![Image 9: Internet Explorer](#)![Image 10: Firefox](#)![Image 11: Opera](#)![Image 12: Google Chrome](#)![Image 13: Safari](#) Almost all major browsers do not support the textDecorationLine property. Firefox supports an alternative property to this one, the MozTextDecorationLine property. * * * ## Syntax Return the textDecorationLine property: ```javascript object.style.textDecorationLine Set the textDecorationLine property: ```javascript object.style.textDecorationLine="none|underline|overline|line-through|initial|inherit" ## Property Values | Value | Description | | --- | --- | | none | Default value. Specifies no lines should be drawn. | | underline | Specifies a line should be drawn below the text. | | overline | Specifies a line should be drawn above the text. | | line-through | Specifies a line should be drawn through the text. | | initial | Sets this property to its default value. Read about _initial_ (#). | | inherit | Inherits this property from its parent element. Read about _inherit_ (#). | ## Technical Details | Default Value: | none | | --- | --- | | Return Value: | A String, representing the text-decoration-line property of an element. | | CSS Version | CSS3 | * * * ## Related Articles CSS Reference: (#) * * Style Object](#)
← Prop Style TextdecorationstyleProp Style Textdecorationcolor β†’