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) Basic Layout box-sizing and max-width

Using 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?

Antti Lylander
Antti Lylander
9,686 Points

Show all of your code, please. Easiest way is to take a snapshot.

8 Answers

Yeah, my code is like 200 lines so it's a bit too long to post.

Antti Lylander
Antti Lylander
9,686 Points

Well, 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.

It 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
Antti Lylander
9,686 Points

try removing the extra */ at the end of line 42. Didn't find anything else at first glance.

Yeah 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
Antti Lylander
9,686 Points

I 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.

It'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.

Thank you. It didn't find anything weird at all.. Damn it! Good tool though!

Found it! Import was not allowed below the *-rule! I had to put my import first, then it worked.

Antti Lylander
Antti Lylander
9,686 Points

This is why it is a good idea to post all code. Often the error is not where you think it is. :)