View video tutorial

CSS Text Spacing

CSS

This is used to specify the space between letters, words in a text.

CSS Text Spacing.

CSS has the following properties for text spacing.

  • text-indent
  • letter-spacing
  • line-height
  • word-spacing
  • white-space

CSS Text Indentation.

The CSS text-indent property is used to specify the indentation of the first line of a text.

This can be done in following ways.

Example

p {
  text-indent: 50px;
}
Try it Now »

Click on the "Try it Now" button to see how it works.


CSS Letter Spacing.

The letter-spacing property is used to specify the space between the characters in a text.

This can be done in following ways.

Example

#p1 {
  letter-spacing: 5px;
}
#p2 {
  letter-spacing: -2px;
}
Try it Now »

Click on the "Try it Now" button to see how it works.


CSS Line Height.

The line-height property is used to specify the space between lines.

This can be done in following ways.

Example

#p1 {
  line-height: 0.8;
}
#p2 {
  line-height: 1.8;
}
Try it Now »

Click on the "Try it Now" button to see how it works.


CSS Word Spacing.

The word-spacing property is used to specify the space between the words in a text.

This can be done in following ways.

Example

#p1 {
  word-spacing: 10px;
}
#p2 {
  word-spacing: -2px;
}
Try it Now »

Click on the "Try it Now" button to see how it works.


CSS White Space.

The white-space property is used to specifies how white-space inside an element is handled.

This can be done in following ways.

Example

#p1 {
  white-space: nowrap;
}
Try it Now »

Click on the "Try it Now" button to see how it works.