Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS How to Make a Website Customizing Colors and Fonts Resize Text

Carl Prude
PLUS
Carl Prude
Courses Plus Student 1,627 Points

Line-height ems are relative to what?

I understand font-size ems are relative to the font size of 16. But what are line-height ems relative to, since this refers to spacing?

2 Answers

Philip Cox
Philip Cox
14,818 Points

I believe it's the current line-height of the parent. This would be the default line-height. As for what this is, I don't know, I could not find it. MDN says its 1.2em though, 1.2 of what? It did not say. :)

It's slightly different in each browser. It's close to 1.1em (which is about 18-ish pixels). This will answer your question more thoroughly: http://stackoverflow.com/questions/2734076/some-questions-about-line-height

Philip Cox
Philip Cox
14,818 Points

ahhh, so 1.1 - 1.2 of the default 16px.

Yep, em is always relative to the font size, despite the properties in which it is used with.