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!
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
In order to get the em equivalent for margin, do we have to divide with the font size value only?
The video states, in order to get the em equivalent value for margin we have to divide it with the value we use to get the em equivalent to font-size. My question is, does it have to be the font-size or is the property that has an em equivalent, or if there isn't do we divide it with the default px to get the em equivalent for margin?
(I stopped at this specific part, because it was quite confusing. I assume the rest of the video might clarify, but still wanted to ask.)
Hi folks -
I am following up on the above comment, because I am trying to better understand this concept as well. Full disclosure: Math does not come easily to me, so I have to work extra hard at making sense of equations, however "simple" some may deem them!
If I am understanding correctly, I will declare a font-size (in the example in the video, the font-size was translated to em units, but that is neither here nor there). THEN, for future calculations of any descendants, I will always be dividing by that previously declared font-size in pixels to arrive at the em value.
Am I on the right track? Thanks in advance for any responses!