CSS Letter Spacing
- Previous Page CSS Text Transformation
- Next Page CSS Text Shadow
Text indentation
text-indent
This property is used to specify the indentation of the first line of the text:
Example
p { text-indent: 50px; }
Letter spacing
letter-spacing
This property is used to specify the spacing between characters in the text.
The following example demonstrates how to increase or decrease the spacing between characters:
Example
h1 { letter-spacing: 3px; } h2 { letter-spacing: -3px; }
Line height
line-height
The attribute is used to specify the space between lines:
Example
p.small { line-height: 0.8; } p.big { line-height: 1.8; }
Word spacing
word-spacing
The attribute is used to specify the space between words in text.
The following example demonstrates how to increase or decrease the space between words:
Example
h1 { word-spacing: 10px; } h2 { word-spacing: -5px; }
Whitespace
white-space
The attribute specifies how white space is handled within an element.
This example demonstrates how to disable text wrapping within an element:
Example
p { white-space: nowrap; }
- Previous Page CSS Text Transformation
- Next Page CSS Text Shadow