CSS Text

css

CSS provides a number of properties for styling text in your HTML documents. Here are some of the most common ones:

  1. color: This property allows you to specify the color of the text. You can specify the color using either a predefined color name, a hexadecimal color code, an RGB value, or an HSL value.
body {
    color: red;
}
  1. text-align: This property allows you to specify how the text should be aligned within its containing element. The possible values are left, center, right, and justify.
body {
    text-align: center;
}
  1. text-decoration: This property allows you to specify the appearance of decorative lines that are added to the text. The possible values are none, underline, overline, line-through, and blink.
body {
    text-decoration: underline;
}
  1. text-transform: This property allows you to specify the case of the text. The possible values are none, capitalize, uppercase, and lowercase.
body {
    text-transform: uppercase;
}
  1. text-indent: This property allows you to specify the amount of indentation that should be applied to the first line of text in a block. You can specify the indentation using either absolute or relative units.
body {
    text-indent: 2em;
}

You can use these properties, either individually or in combination, to specify a wide range of text styles for your HTML elements. It’s a good idea to familiarize yourself with all of these properties so that you can choose the most appropriate ones for your needs.