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
shyarkhalil
Front End Web Development Techdegree Graduate 17,762 PointsHello everyone! Could you please help me what does the second value auto mean? I really do not get this value.
In the Center the Wrapper video, I am little bit struggling with the understanding of the AUTO VALUE. I am replaying the video but still not getting it. Could you please help me to understand it well? I appreciate any help. Thanks a lot! Shyar
2 Answers
Christopher Collins
Front End Web Development Techdegree Student 6,343 PointsHi Shyar,
Are you referring to a declaration such as the example below?
.class { margin: 0 auto; }
If so, the 'auto' will be the value to determine the left and right margins of the page. the '0' will define the top and bottom values. Basically, the auto function will take any remaining space left in the elements parent and divide it evenly between the left and the right side of the element. This is why it make such a great property for centering items.
Does this make sense? I hope I am answering for the correct 'auto' function that you are referring too!
shyarkhalil
Front End Web Development Techdegree Graduate 17,762 PointsHello Christopher, Thanks a lot for your answer. Let's say I kind of understand what you explained to me, but in the Center the Wrapper video, from 2:58 till the end, I do not understand why the orange background is not align with the photos. Any idea? Thanks again! Shyar
Alexander Davison
65,469 PointsAlexander Davison
65,469 PointsThanks! I always wanted to know what auto was for too. :)