cssNUT
cssNUT

Reputation: 41

CSS line-height question

What is the ideal line-height and what type of value should I use with line-height values, em, px or percentages?

Upvotes: 4

Views: 968

Answers (5)

Beau
Beau

Reputation: 1771

The ideal line-height is 1.3.

Note that I didn't use a unit for that.

Upvotes: 1

mahalie
mahalie

Reputation: 2657

As Alex points out, you should use em, percent or whole numbers for line-height so it scales well. See line-height on the Mozilla Developer's Network reference for further explanation.

p{
 font: normal 10pt/1.5 sans-serif;
}

Upvotes: 1

supakeen
supakeen

Reputation: 2914

A lot of people tend to use 1.2-1.5 em as this is relative to your font size and had a nice 'look' to it. I am sure a typographer could explain more fully where those values come from.

Upvotes: 4

pixeline
pixeline

Reputation: 17974

It is usually considered for a comfortable reading experience that line height should be 1.5 to 2 times the size of the font.

p{
font: normal 10pt/15pt sans-serif;
}

Note that it depends on the font you use. In web design, every rule has to be taken with a grain of salt.

Upvotes: 4

Alex Mcp
Alex Mcp

Reputation: 19315

em is relative and will scale nicely when/if your users change the text size (which my mom, for example, often does for readability reasons).

Upvotes: 4

Related Questions