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 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