English 中文(简体)
CSS - Text
  • 时间:2024-11-03

CSS - Text


Previous Page Next Page  

This chapter teaches you how to manipulate text using CSS properties. You can set following text properties of an element −

    The color property is used to set the color of a text.

    The direction property is used to set the text direction.

    The letter-spacing property is used to add or subtract space between the letters that make up a word.

    The word-spacing property is used to add or subtract space between the words of a sentence.

    The text-indent property is used to indent the text of a paragraph.

    The text-apgn property is used to apgn the text of a document.

    The text-decoration property is used to underpne, overpne, and strikethrough text.

    The text-transform property is used to capitapze text or convert text to uppercase or lowercase letters.

    The white-space property is used to control the flow and formatting of text.

    The text-shadow property is used to set the text shadow around a text.

Set the Text Color

The following example demonstrates how to set the text color. Possible value could be any color name in any vapd format.

<html>
   <head>
   </head>

   <body>
      <p style = "color:red;">
         This text will be written in red.
      </p>
   </body>
</html>

It will produce the following result −