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

Changing font size in CSS from px to em makes font disappear?

Hey Everyone!

I'm working on a project at http://likewater.ca

I'm trying to change the font inside the header where it says 'Flow' along with the slogan etc.. basically all of the font on the site from px to em

When I make the change in inspector or on safari the font disappears and does not show up.

How can I change the font from pixels to em? Does it have something to do with the root? Even % does not work either.

I'm more of a back-end developer/designer and do not have much experience with font-sizes in CSS and the appropriate ones to use. I figured em would be best for mobility.

Thanks guys

1 Answer

Simon Woodard
Simon Woodard
6,545 Points

The parent element span#headerImg has declared a 0px font size, therefore any child elements with font sizes declared in ratios like em or % will obviously be 0 as well

Thanks a lot Simon!

That cleared everything up for me, such an easy fix.