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 CSS Foundations Text, Fonts, and Lists List Styles

I don't know how to add a bottom margin to my list in CSS. Have used margin-bottom property but doesn't seem to work

ul { margin-bottom: 20px; }

index.html
<!DOCTYPE html>
<html>
<head>
    <title>Lists</title>
    <link rel="stylesheet" href="page.css" />
    <link rel="stylesheet" href="style.css" />
</head>
<body>
    <ul>
        <li>Viverra rutrum orci lacinia iaculis mi per fermentum tortor malesuada, nullam morbi fringilla augue arcu primis torquent</li>
        <li>Id aliquam nisi accumsan felis pretium enim arcu fames</li>
        <li>Eros mollis sociosqu condimentum lectus cursus pellentesque et laoreet</li>
        <li>Duis nullam accumsan conubia auctor aliquam posuere nam tortor mollis a</li>
    </ul>
</body>
</html>
style.css
/* Complete the challenge by writing CSS below */
ul {
  list-style-type: none;
  list-style-image: img('marer.png');
  margin-bottom: 20px;
}

2 Answers

LaVaughn Haynes
LaVaughn Haynes
12,397 Points

If you are trying to add a margin-bottom to the individual elements in your list you would write

ul li {
    margin-bottom: 20px;
}

Hey,

Is your answer not letting you progress?

looking at your current code it should pass.