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
Voyti 1
1,854 PointsWhy the orange background is affected by the "max-width", but the image (No12) is not?
In the video you can see that the orange background has 940 pixels width, but the image (number 12) is wider than that. What elements are affected by the width property and which ones are not?
3 Answers
Steven Parker
243,656 Points
The width could be overridden by another rule or property.
Since you didn't provide a link to the video this is only a guess, but the width property of the image could possibly be overridden by a later rule, or a rule with higher specificity, or by either the min-width or the max-width properties.
Voyti 1
1,854 PointsSorry, I'm new to the forum. It's this video: https://teamtreehouse.com/library/how-to-make-a-website/css-cascading-style-sheets/center-the-wrapper You can see it in 3.18 minute
Jason Anello
Courses Plus Student 94,610 PointsHi Woyteck,
At the moment, the images are displaying at their native size because neither a width or height has been set on them. I think they were 1024x768 which means they are wider than the wrapper div which can't be more than 940px.
Right now they're overflowing their container. Later, you'll set a width on the images so that they'll be restricted to fit inside their container.