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 Center the Wrapper

IT WONT CENTER. yes it is routed the right way because it changes color.

This is my CSS code:

a {
 text-decoration: none; 
}

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

but for some reason it won't center. I know I routed everything correctly because when i try to change color it works it just won't center.

my code is typed correctly IDK why it won't show the hash in the forum when i copy and paste it but it does have the # in the actual code.

1 Answer

Jeff Lemay
Jeff Lemay
14,268 Points

You haven't set a max-width for the wrapper, you need to add px.

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

you are the man!!!!!!!!!!!!!!! THANKS A LOT!!!!!!

Jeff Lemay
Jeff Lemay
14,268 Points

No problemo, enjoy the journey!