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 trialNathalie Agnekil
6,665 PointsUsing box-sizing in universal makes everything else disappear
so, when i enter *{ box-sizing: border-box}
to my document, everything else is like overruled. My content is the same structure as before, so i get to keep my floats and paddings and margins and so on, but my content looses EVERYTHING that has to do with fonts and colors so my text is just some kind of default. What's up with that?
8 Answers
Nathalie Agnekil
6,665 PointsYeah, my code is like 200 lines so it's a bit too long to post.
Antti Lylander
9,686 PointsWell, it's not too long. And if you have it in workspaces, you can always take a snapshot and share the link. Always better idea to share whole code as often the problems are easier to understand when you have it all.
You are missing ; in your rule. Should be *{ box-sizing: border-box;}
but I'm not sure if that will solve the problem as the semicolon after the last property in a rule should be optional.
Nathalie Agnekil
6,665 PointsIt doesn't solve it with a semicolon. I've uploaded my code to Pastebin for the day; https://pastebin.com/MyNwcAkP
Terribly sorry about the mess this is just for me to play around in, not meant for anyone else to see.
Antti Lylander
9,686 Pointstry removing the extra */ at the end of line 42. Didn't find anything else at first glance.
Nathalie Agnekil
6,665 PointsYeah I must have just missed that when I was editing to give this to you. I removed all my personal comments. So that's not in my actual code.
Antti Lylander
9,686 PointsI don't think the *{ box-sizing: border-box} alone can cause that. There must be something else. Some bracket missing or somewhere something that don't belong there.
Nathalie Agnekil
6,665 PointsIt's when i add the *-rule that everything just collapses. Otherwise it's all good. I've been over and over it checking every line, and I just can't figure it out.
Antti Lylander
9,686 Pointshttp://csslint.net/ this is my last idea :)
Nathalie Agnekil
6,665 PointsThank you. It didn't find anything weird at all.. Damn it! Good tool though!
Nathalie Agnekil
6,665 PointsFound it! Import was not allowed below the *-rule! I had to put my import first, then it worked.
Antti Lylander
9,686 PointsThis is why it is a good idea to post all code. Often the error is not where you think it is. :)
Antti Lylander
9,686 PointsAntti Lylander
9,686 PointsShow all of your code, please. Easiest way is to take a snapshot.