letter-spacing - HTML CSS CSS Property

HTML CSS examples for CSS Property:letter-spacing

Description

The letter-spacing CSS property sets the spacing between the letters of text.

The following table summarizes the letter-spacing Property.

Item Value
Default value: normal
Applies to:All elements. It also applies to ::first-letter and ::first-line.
Inherited: Yes
Animatable: Yes.

Syntax

The syntax of the property is as follows:


letter-spacing:      length | normal | initial | inherit

Property Values

The following table describes the values of this property.

Value Description
normal normal spacing for the current font. This is default.
length A length value specifies extra space to be inserted between characters in addition to the default inter-character space.
initial Sets this property to its default value.
inherit take the value of its parent element letter-spacing property.

The example below shows the letter-spacing property.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html lang="en">
 <head>
  <title>Example of CSS letter-spacing property</title>
  <style type="text/css">
    h1 {<!--from w w w . j a  v a  2s  .  c om-->
        letter-spacing: -3px;
    }
    p {
        letter-spacing: 15px;
    }
</style>
 </head>
 <body>
  <h1>This is a heading.</h1>
  <p>This is a paragraph.</p>
 </body>
</html>

Related Tutorials