HTML CSS examples for CSS Property:letter-spacing
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. |
The syntax of the property is as follows:
letter-spacing: length | normal | initial | inherit
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.
<!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>