CSS Text

You will learn how to style text on your web pages using CSS in this tutorial.

Many text properties are available for formatting Text with CSS.

CSS provides several properties that allows you to define various text styles such as color, alignment, spacing, decoration, transformation, etc.

The commonly used text properties are below.

  1. color: The color property is used to set the color of a text.
  2. direction : The direction property is used to set the text direction.
  3. letter-spacing : The letter-spacing property is used to add or subtract space between the letters that make up a word.
  4. word-spacing : The word-spacing property is used to add or subtract space between the words of a sentence.
  5. text-indent : The text-indent property is used to indent the text of a paragraph.
  6. text-align : The text-align property is used to align the text of a document.
  7. text-decoration : The text-decoration property is used to underline, overline, and strikethrough text.
  8. text-transform : The text-transform property is used to capitalize text or convert text to uppercase or lowercase letters.
  9. white-space : The white-space property is used to control the flow and formatting of text.
  10. text-shadow  : The text-shadow property is used to set the text shadow around a text.

    Syntax:

<style>
h1{
    color:red;
    text-align:center;
    text-decoration:overline;
    text-indent:inherit;
    text-shadow:#000033;
    text-transform:capitalize;
    white-space:nowrap;
    word-spacing:normal;
    letter-spacing:normal;
    direction:ltr;
}
</style>

    

 

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

64837