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