Space between letters css code example

Example 1: letter spacing css

div{
   letter-spacing: 2px; 
}

Example 2: letter spacing css

div{
   letter-spacing: 2px; 
}

Example 3: kerning css

// There is no kerning property, but you can use letter-spacing
div{
   letter-spacing: 2px; 
}

Example 4: space-between css

/* Positional alignment */
justify-content: center;     /* Pack items around the center */
justify-content: start;      /* Pack items from the start */
justify-content: end;        /* Pack items from the end */
justify-content: flex-start; /* Pack flex items from the start */
justify-content: flex-end;   /* Pack flex items from the end */
justify-content: left;       /* Pack items from the left */
justify-content: right;      /* Pack items from the right */

/* Baseline alignment */
/* justify-content does not take baseline values */

/* Normal alignment */
justify-content: normal;

/* Distributed alignment */
justify-content: space-between; /* Distribute items evenly
                                   The first item is flush with the start,
                                   the last is flush with the end */
justify-content: space-around;  /* Distribute items evenly
                                   Items have a half-size space
                                   on either end */
justify-content: space-evenly;  /* Distribute items evenly
                                   Items have equal space around them */
justify-content: stretch;       /* Distribute items evenly
                                   Stretch 'auto'-sized items to fit
                                   the container */

/* Overflow alignment */
justify-content: safe center;
justify-content: unsafe center;

/* Global values */
justify-content: inherit;
justify-content: initial;
justify-content: unset;

Example 5: letter spacing css

.some-class {
   letter-spacing: 3px; 
}

Example 6: letter spacing css

<!DOCTYPE html>
<html lang="en">
   <head>
      <meta charset="UTF-8" />
      <title>Letter spacing in CSS</title>

      <style>
         .normal {
            letter-spacing: normal;
         }
         .em-wide {
            letter-spacing: 0.4em;
         }
         .em-wider {
            letter-spacing: 1em;
         }
         .em-tight {
            letter-spacing: -0.05em;
         }
         .px-wide {
            letter-spacing: 6px;
         }
      </style>
   </head>
   <body>
      <p class="normal">letter spacing</p>
      <p class="em-wide">letter spacing</p>
      <p class="em-wider">letter spacing</p>
      <p class="em-tight">letter spacing</p>
      <p class="px-wide">letter spacing</p>
   </body>
</html>

<!-- /* Keyword value */
   letter-spacing: normal;

   /* <length> values */
   letter-spacing: 0.3em;
   letter-spacing: 3px;
   letter-spacing: .3px;

   /* Global values */
   letter-spacing: inherit;
   letter-spacing: initial;
   letter-spacing: unset; 
-->

Tags:

Css Example