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 trialPedro nieto Sanchez
28,169 PointsWhat am I doing wrong?
wrapper {
max-width: 940px; margin-left: auto; margin-right: auto; }
#wrapper {
max-width: 940px;
margin-left: auto;
margin-right: auto;
}
Pedro nieto Sanchez
28,169 PointsThe requirement is to center the element, but i get it wrong for some reason.
Pedro nieto Sanchez
28,169 PointsThe requirement is to center the element, but i get it wrong for some reason.
2 Answers
William Li
Courses Plus Student 26,868 Pointsand then center it on the page using the margin property.
Hi, there. The challenge is asking you to use of margin
property ONLY; not margin-left
or margin-right
.
#wrapper {
max-width: 940px;
margin: 0 auto;
}
Pedro nieto Sanchez
28,169 PointsThanks William you are my angel. :)
Richard Nicholls
1,301 Pointsyou need to use margin 0 auto like this
wrapper {
max-width: 940px; margin: 0 auto; }
Pedro nieto Sanchez
28,169 PointsPedro nieto Sanchez
28,169 PointsThe requirement is to center the element, but i get it wrong for some reason.