CSS letter-spacing

The CSS letter-spacing property is used to define the length of white spaces between letters/characters. For example:

HTML with CSS Code
<!DOCTYPE html>
<html>
<head>
   <style>
      p{letter-spacing: 8px;}
   </style>
</head>
<body>
   
   <p>Lorem ipsum dolor sit amet consectetur, adipisicing elit.</p>
   
</body>
</html>
Output

Lorem ipsum dolor sit amet consectetur, adipisicing elit.

CSS letter-spacing Syntax

The syntax of letter-spacing property in CSS, is:

letter-spacing: x;

The value of x should be any of the following:

  • normal - used not to define custom length white space between letters. This is the default value
  • length - used to define the custom length to white spaces between all letters. For example: 4px, 1cm, -2px etc.
  • initial - used to use the default value
  • inherit - used to use the value inherited by the parent element

CSS Online Test


« Previous Tutorial Next Tutorial »



Like/Share Us on Facebook 😋