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

Select the ID wrapper, set it to a max width of 940 pixels, and then center it on the page using the margin property.

What am I doing wrong here?

wrapper {

max-width : 940px; margin : 0 auto; }

10 Answers

Jorge Calvo
Jorge Calvo
1,727 Points

Notice you have a blank space between "margin" and ":". This could be the mistake. Same for "max-width".

This code should work:

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

If not, check your html or if you want feel free to send me the index.html and your css stylesheet at jorge@sensationalfix.com and i'll check your project.

;)

Thanks, the spaces caused the errors.

Jorge Calvo
Jorge Calvo
1,727 Points

wrapper {

max-width : 940px;
margin : 0 auto;

}

Michael Araromi, You need to keep the code CSS of the last task.

a { text-decoration: none; }

wrapper{

max-width: 940px; margin: 0 auto; }

Jorge Calvo
Jorge Calvo
1,727 Points

I think you forget the "#" for the div selector.

Thanks Jorge, the # is included in the code, I don't know why it's not showing on the discussion. These are my codes:

wrapper {

max-width : 940px; margin : 0 auto; }

but it's still not working.

how do you check the margin values in your css?

what is the main use of the # on the wrapper

Can someone please explain to me why max width (940px) only have one property and margin has two (0, auto)?

Is it because max width is a property that takes up space where as margin is something that is being placed on the page?

you have to write # right before wrapper.