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 CSS Foundations Values and Units Relative Length Units

Krista Gomke
Krista Gomke
4,426 Points

Using the em unit?

Web Design code challenge (Stage 4, Values and Units) says: "Using the em unit, set the font size to 24 pixels"

It would not accept any em values, but when I used 24px as my font size, it advanced the lesson.

I am confused.

2 Answers

Joel Encinas
Joel Encinas
9,683 Points

Well the output size is the same if you put 24px or 1.5em (1em = 16px), is the same that if you say 1 meter or 100 centimeters, is the same to the eye, but just remember the pros of using a relative unit like ems instead of units like pixels.

Krista Gomke
Krista Gomke
4,426 Points

Right... but if the question is asking for ems, it probably shouldn't accept an answer using px... right?

Joel Encinas
Joel Encinas
9,683 Points

I agree with you, i forgot to write that it seems strange to me too haha