Skip to content

More Text Options

Text decoration and alignment

  • Lesson
  • 1 min read
  • 6 of 8 in this chapter

text-decoration

We can underline text using the text-decoration property:

CSS
h1 {
    text-decoration: underline;
}

Other common values for this property are strikethrough (~~looks like this~~) and none, which removes decoration if it was present.

text-align

The text-align property can be set to right, left (default), center, or justify (aligns on both left and right). Here's an example:

CSS
p {
    text-align: justify;
}