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 trialdiegoholt
1,076 Points"auto" help.
Could I get some clarification when he explains what "auto" is doing at 2:56? What does it mean that it will fill it in with whatever is left over?
What would happen if we didn't type in "auto" there?
1 Answer
Florian Tönjes
Full Stack JavaScript Techdegree Graduate 50,856 PointsDiego,
the '0 auto' as a margin value means, that the browser will check how wide the wrapper element is. It then substracts the wrapper's width from the total width of it's parent element. Now the browser knows how much space of the parent element is not occupied on the sides. It divides this space by two and applies it as margin to both sides of the wrapper, so that it is centered within it's parent element. Without the 'auto' value the wrapper would just stick to the left side.
Regards, Florian
diegoholt
1,076 PointsOhhh, that makes sense! Awesome, thanks :)
Cindy Lea
Courses Plus Student 6,497 PointsCindy Lea
Courses Plus Student 6,497 PointsAuto in this case means the browser determines the justification. The default is auto so if you leave it out it will be the same affect.