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

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

Gábor Tóth
Gábor Tóth
11,958 Points

Can't understand the video.

I could easily understand and the follow the viedos so far, but this is really confusing. When he says, the div is now centered, it's not. Then he is talking about scroll bars but he should focus on why the image doesn't fit into the div. Please explain it me.

1 Answer

Actually div was centered but those images he uses on the workspaces have more width then 940px that's why those images are not centered but if you add a style like

img{
   max-width: 100%;
}

Then images will decrease their width to 940px

It worked for me. So why set it to 940px if it is flawed?