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 How to Make a Website CSS: Cascading Style Sheets Style the Basic Elements

Trouble with max-width

This is the code I'm using in a code challenge to set the max width to 940 pixels and center it using the margin property. I got an error saying: "Check the max width value". Any ideas what I'm doing wrong? Thanks!

#wrapper {
  max-width: 940px;
  margin: 0 auto;
}

3 Answers

Maxim Markov Your code is correct, try refreshing the browser sometimes they can lose the connection to the code engine and all sorts of crazy stuff can happen. :)

Rose Hurst
Rose Hurst
5,658 Points

Wrapper is a class so it would need

.wrapper { }

Ugh, my apologies. I've forgotten if it was used as a class. I'd have to go back and take a look again at that challenge.

I'm sorry, wrapper is actually an ID. I had #wrapper in my code, but just failed to copy and paste correctly.

Hello, for the same challenge i noticed that if you put a space beween the property margin and the folowing colon ( : ) the compiler see this as an error. I think there is something wrong with the way that challenge is corrected.