News & UpdatesProgrammingWeb programming Store My Projects

CSS Tutorial – 13 – Spacing

CSS tutorials

The following properties deal with the space between elements.


Line-height sets the distance between lines. By default, an element will inherit the line height of its parent and the initial value is “normal”. The line height can also be set to a length, a percentage of the current font size, or a number that will be multiplied with the current font size.

line-height : inherit | normal | <length> | 
              <percentage> | <number>

Word-spacing and letter-spacing

Word-spacing sets the spacing between words and letter-spacing sets spacing between individual characters. Negative values are allowed for both of these properties.

word-spacing : inherit | normal | <length>
letter-spacing : inherit | normal | <length>

White-space property

White-space can change how white space characters inside of a block element are handled. Setting whitespace to preformatted (pre) makes the browser ignore the whitespace and “nowrap” lets text continue without wrapping at the edges of the block.

white-space (block) : inherit | normal | pre | nowrap
Recommended additional reading:
Sams - Teach Yourself HTML and CSS in 24 Hours