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;

}

Elizabeth Stone
Elizabeth Stone
6,457 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!

1 Answer

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