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!
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
width: 100% X max-width: 100%
Why not to use just width: 100% instead of max-width: 100%?
Steven Parker225,712 Points
Those mean different things. A "
width: 100%" setting would require the element to span the entire window and force it to expand to fill (or shrink to fit) the space.
max-width: 100%" would still shrink the element to fit if it was too large, but it would not cause the element to expand if it was smaller than the full size.