Open In App

CSS letter-spacing Property

The letter-spacing property in CSS is used to set the spacing behavior between text characters i.e increasing or decreasing the space between characters in a text. 

Syntax:



letter-spacing: normal|length|initial|inherit;

Property values:

Example: In this example, we are using the above-explained property.






<!DOCTYPE html>
<html>
   
<head>
    <title>CSS letter-spacing Property</title>
    <style>
        p {
            letter-spacing: normal;
        }
    </style>
</head>
 
<body style="text-align: center;">
    <h1 style="color:green;">
        GeeksforGeeks
    </h1>
 
    <h2>
        CSS letter-spacing Property
    </h2>
 
    <p>
        This paragraph has letter-spacing: normal;
    </p>
</body>
   
</html>

Output: 

Example: In this example, we are using letter-spacing: length; property.




<!DOCTYPE html>
<html>
   
<head>
    <title>CSS letter-spacing Property</title>
    <style>
        p {
            letter-spacing: 5px;
 
        }
    </style>
</head>
 
<body style="text-align: center;">
    <h1 style="color:green;">
        GeeksforGeeks
    </h1>
 
    <h2>
        CSS letter-spacing Property
    </h2>
 
    <p>
        This paragraph has letter-spacing: 5px;
    </p>
</body>
   
</html>

Output: 

Supported Browsers: The browser supported by letter-spacing property are listed below:


Article Tags :