CSS
Spacing

There are two types of spacing properties in CSS.

  1. Letter Spacing
  2. Word Spacing

Letter Spacing

The letter-spacing defines the spacing between the characters of a block of text.

Syntax:
Example:

<!doctype html>  
<html>
    <head>
        <title>...</title>
    </head>
  
    <body>
       <p style="letter-spacing: 3px;">You can learn programming languages from PHPDocs.</p>
    </body>
</html>

Word Spacing

The word-spacing defines the length of space between words and tags.

Syntax:
Example:

<!doctype html>  
<html>
    <head>
        <title>...</title>
    </head>
  
    <body>
       <p style="word-spacing: 3px;">You can learn programming languages from PHPDocs.</p>
    </body>
</html>


Units

The possible units can be used for these properties are as follows:

ValuesDescription
pixelValues with “px” e.g. 3px, 4px
remValues with “rem” e.g. 1rem, 6rem
normalIt alters the space between characters in order to justify text.