Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML How to Make a Website CSS: Cascading Style Sheets Center the Wrapper

Why do pictures hang over and outside a Wrapper with a max-width?

In How To Make a Website, chapter 4: 'Centre the Wrapper', the Wrapper has a max-width of 940px but the pictures contained in the Wrapper hang over and outside the wrapper.

Is this meant to happen? I thought that the Wrapper by default would be stretched to the outside width of the pictures contained within it.


Although I've checked out the Markdown Cheatsheet I'm not having much luck attaching a screen shot showing what I want to question. Any suggestions? (I've uploaded the screen shot to my only workspace)


screen shot

2 Answers

if the wrapper has a maximum width of 940px then any image or picture larger than that will hang over or outside the wrapper.

Thanks Kevin.

If the wrapper did not use the max-width property and only used a width property of 940px would the pictures with a greater width force the width of that containing wrapper?