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
matt koracin
2,347 Pointstextual values difference
What's the difference between "auto" and "initial" values? It seems they're the same to me: the browser default.
2 Answers
Zen Hess
6,700 PointsInitial values are indeed "browser default" values. Auto values on the other hand are values set according to the context of the element. For example, if you are trying to center an item within a div, its initial value will likely be aligned left (assuming there are not previous style sheets effecting it). When you set this item to auto, then the margins will be adjusted in such a way that it is centered.
So, initial is the browser default; auto is a styling based on the content and its surroundings.
matt koracin
2,347 Pointscool, thanks