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
Alexey Tseitlin
5,866 PointsWrapper question
Just experimenting and wondering why "up" and "down" wrapper margin doesn't work the same as "left" and right" margin. This is what I mean:
This code adds space on the left.
'''Css .wrapper { max-width: 940px; Margin: 0 auto; } '''
But if i change "max-width: 940px;" to "max-hight: 940px"
And "Margin: 0 auto" to margin: auto 0"
It doesnt do anything. Why is that?
1 Answer
Jonathan Grieve
Treehouse Moderator 91,254 PointsI can't imagine it doesn't work the same way,
Are you changing the browser height by taking out of maximum scale and dragging it from the bottom?
Also Margin: isn't the correct keyword property. "margin shouldn't be capitalised, so you might get better results if you try something like,
.wrapper {
max-height: 940px;
margin: auto 0;
}
But this won't center the element the way it does with 0 auto. :-)
Alexey Tseitlin
5,866 PointsAlexey Tseitlin
5,866 PointsYes) is it possible?