CSS Text Styling

Styling Text Content

CSS has many properties for formatting text including color, alignment, decoration, transformation, spacing, and more.

h1 {
  color: navy;
  text-align: center;
  text-transform: uppercase;
}

p {
  text-align: justify;
  text-indent: 50px;
  line-height: 1.8;
  letter-spacing: 1px;
  word-spacing: 3px;
}

a {
  text-decoration: none;
}
  • color - Text color
  • text-align - Horizontal alignment
  • text-decoration - Underline, overline, line-through
  • text-transform - Uppercase, lowercase, capitalize
  • line-height - Space between lines
  • letter-spacing - Space between characters

Try Text Styling

<h1>Styled Heading</h1>
<p>This paragraph has custom text styling including alignment, spacing, and indentation.</p>
<a href="#">Styled Link</a>

Note: text-decoration: none is commonly used to remove underlines from links.