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 trialCarl Prude
Courses Plus Student 1,627 PointsLine-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
14,818 PointsI 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. :)
Joseph Potts
11,187 PointsIt'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
14,818 Pointsahhh, so 1.1 - 1.2 of the default 16px.
Joseph Potts
11,187 PointsYep, em is always relative to the font size, despite the properties in which it is used with.