text-decoration

To add lines on the text.

Syntax

text-decoration: <text-align-value>;

The text-decoration-value can be the following:

  • none
  • underline
  • overline
  • line-through

Example 1

Set the p tag to center:

p {
text-decoration: underline;
}

Above code indicating that the text in p tag will be underlined.

Contributors

Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.

Learn CSS on Codecademy

Contributors