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 trialMichael Araromi
349 PointsSelect 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
1,727 PointsNotice 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.
;)
Jorge Calvo
1,727 Pointswrapper {
max-width : 940px;
margin : 0 auto;
}
amélie Brignon
1,387 PointsMichael 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
1,727 PointsI think you forget the "#" for the div selector.
Michael Araromi
349 PointsThanks 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.
Richard Targett
4,960 Pointsthanks amelie
valentino castilo
304 Pointshow do you check the margin values in your css?
claudius mainja
9,661 Pointswhat is the main use of the # on the wrapper
Learning coding
Front End Web Development Techdegree Student 9,937 PointsWhy doesn't this code work?
wrapper{
max-width: 940px; margin: 0 auto; }
Is it because the index.html page is empty?
Scott Delman
5,436 PointsCan 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?
eusebio gonzalez
837 Pointsyou have to write # right before wrapper.
Michael Araromi
349 PointsMichael Araromi
349 PointsThanks, the spaces caused the errors.