CSS Text-decoration: It is an essential property of CSS that is used to decorate the content of the text. It can add-on the lines above, under, and over the text. This property sets the presentation of the decorative line over the text.

 It illuminates the text along with various types of lines. It is used for text-decoration-style, text-decoration-color, and text-decoration-line.

The syntax is as follows for this property:

Syntax:

Let’s understand its values with the help of an example:

  • text-decoration-line

It is used to do text-decoration of various kinds like underline, overline, or line-through. Also, it can add the line combination for any selected text.

Example:

In the following example, we are using the line-through, underline, or overline values. We will also understand how we can simultaneously apply these values.

Output:

CSS Text-decoration
  • text-decoration-style

This CSS values sets the line’s style. Some of its values are dotted, double, dashed, solid, and wavy.

Consider the following illustration:

Example:

Output:

CSS Text-decoration
  • text-decoration-color

This CSS property is applied to give a lot of decoration colors. We can use any color, but in the valid format as its values.

Example:

Output:

CSS Text-decoration

Pin It on Pinterest

Share This