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 Flexbox Layout Flexbox Properties Distributing Space Inside a Flex Container

SeHyun Choi
SeHyun Choi
3,441 Points

I need help with margin-right:auto

I can't seem to get item one to be separated from other items.

Inside of page.css:

.container {
    background-color:#fff;
    border-radius:10px;
    padding:10px;
    width:80%;
    margin:30px auto;
}

.item {
    background-color:salmon;
    margin:5px;
    border-radius:10px;
    padding:10px;
}

Inside of flexbox.css:

.container {
    display:flex;
        flex-wrap:wrap;
    justify-content:space-around;
}

.item1 {
    margin-right: auto;
}

2 Answers

Elizabeth Stone
Elizabeth Stone
6,469 Points

Double-check your syntax. The video example refers to Item 1 as "item-1" in the html file and it looks like you are calling it ".item1" in your css file instead of ".item-1". Hope that helps!

Hi,

Are you using your own text editor? If so, make sure that the the link to the page.css is displayed above the flexbox.css link, in your html head....alternatively, add the "item-1" class to the page.css sheet instead (but i don't know if this way would be good practice).