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 Make a CSS Image Gallery

Ryan Bent
Ryan Bent
6,433 Points

Keeps telling my i've only set one margin

I'm stuck on what to put it says i'm stuck on one margin

1 Answer

Okay. In the challenge, you will have to use margin property in two places.

First you have to remove the margin for gallery ID. You can do that by using following CSS code

    margin: 0;
    /** The above code technically sets the margin to zero. Meaning from most left edge of browser screen **/

I use #(hash) because it is an ID.

Next you have to set margin for list item inside gallery ID. List items are denoted in HTML as <li> In CSS, list items are denoted by "li".

To set margin for list items inside gallery ID. You will have to use descendent selector.

#gallery li{
     margin: 2.5%;

I hope it helps.

Ryan Bent
Ryan Bent
6,433 Points

Ah! That makes sense. Great, thank you!