CSS text-decoration

It is a CSS property that decorates the content of the text. It adds lines under, above, and through the text. It sets the appearance of decorative lines on text. This CSS property decorates the text with several kinds of lines. This is shorthand for text-decoration-line, text-decoration-color, and text-decoration-style.

The syntax of this CSS property is given as follows-

Syntax

Let's discuss its property values along with an example.

text-decoration-line

It sets the kind of text-decoration like overline, underline, or line-through. It can be used to add a combination of lines to the selected text.

Example

In this example, we are going to use the values underline, overline, and line-through. We will also see how to use these values simultaneously.

Test it Now

text-decoration-style

This property is used to set the style of the line. Its values are solid, dotted, wavy, double, and dashed.

The following example explains this property more clearly.

Example

Test it Now

text-decoration-color

This property is used to provide color to the decoration. Its value is any color in a valid format.

Example

Test it Now

Next TopicCSS Lists




Contact US

Email:[email protected]

CSS text-decoration
10/30