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.

CSS How to Make a Website Styling Web Pages and Navigation Style the Portfolio

Euan Burton
Euan Burton
3,037 Points

[SOLVED] ,Concerning margins.

As I understand from the video,

The list items have a width of 45% and a margin of 2.5% on either side.

As explained by Nick in the video, that should leave space such that

[2.5%margin][45%pic][5%margin][45%pic][2.5%margin]

but even in Nick's video the center whitespace between the pics is smaller than on the far right and left sides.

Where is this extra space coming from?

Are there left and right margins affecting ul elements from the normalize.css?

Paul Bentham
Paul Bentham
24,090 Points

Hi Euan,

It's a bit like this:

<---------------------1200px---------------------->       
|  Body  |           Gallery               | Body| 
          <----------- 900px------------->

So your total of 100% will only be for the total width of that element so 900px rather than 1200px leaving you with 150px of whitespace at either side. If the width of the parent element was 100% then there wouldn't be any additional white space

Hope that helps.

Paul