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 trialDavid Douglas
3,719 Pointswidths?
This may be a stupid question. An aside element, for example, has a width of 100% and a max-width of 480px. How is it that if another element within the aside does not have the same set max-width it will extend pass the 480px? Shouldn't the aside's max-width stop element from stretching across the screen?
1 Answer
Steven Parker
231,271 PointsThe max-width
property isn't inherited by default, but you could explicitly set max-width: inherit;
in the inner element.
You could also give the parent element overflow: hidden;
to constrain the visible portion of child elements.