text-decoration

Anonymous contributor's avatar
Anonymous contributor
Anonymous contributor's avatar
Anonymous contributor
Published Jun 30, 2021Updated Sep 3, 2021
Contribute to Docs

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.

All contributors

Looking to contribute?

Learn CSS on Codecademy