Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS

Adam Akers
Adam Akers
7,357 Points

Eric Meyers Reset 2.0 is not allowing me to use 'font-family' in the universal selector (* {})

So far in my process I have been using Eric Meyers 2.0 reset for my pages. Something that I have noticed is that when I try to use font-family: while using his reset it just simply wont work. If I use the same rule down in body{} then I can get the desired effect. I've been able to mimic the same behavior on codepen. I've looked through the reset to see why this is happening. One thing I see is that there is a large list of general selectors and one of the declarations is font: inherit. I commented out this line and the font changed.

My question is, why would that line stop * {font-family: 'Nunito', sans-serif} from being applied to the rest of the document?

2 Answers

jason chan
jason chan
31,008 Points

use body instead not universal selector

Simply you can use

* {font-family: 'Nunito', sans-serif !important;}