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 Basics (2014) Understanding Values and Units Em and Rem Units

Em and rem values challenge in CSS Basics -- Don't understand why it says my answer is wrong?

In CSS Basics, the em and rem challenge, question #2 (have attached code) asks me to determine the em value for a desired font size of 53 pixels, with the parent element being 16 pixels. I divide 53 by 16, and the answer is 3.313 or 3.312, depending on rounding. Why is this answer wrong?

It's showing the wrong challenge if you click "view challenge." The actual one I'm referring to is the one I described above: If the parent element is 16 pixels, and you want the font size in ems to equal 53 pixels, wouldn't you just divide 53 by 16? Answer is 3.313 or 3.312, but doesn't accept either of these.

4 Answers

Steven Parker
Steven Parker
231,275 Points

You said,

the answer is 3.313 or 3.312, depending on rounding.

Remember in the lecture, Guil spoke about being precise with em and rem values. Instead of rounding or truncating, try the exact value of 3.3125em.

Sorry, new here and just learning how things are done. Thanks again, marked your answer "best answer."

shellybrown
shellybrown
1,353 Points

Thank you, I was having the same problem.

Glad it helped you, too, Shelly. Sometimes it's the tiniest of details that get in the way, I suppose.