Reputation: 4090
Good day,
I have one question
Can i use at once flex and justify-content ?
i want that "flex-item(s)" have the full size container and simultaneously space between it
<ul class="flex-container space-between">
<li class="flex-item">1</li>
<li class="flex-item">2</li>
<li class="flex-item">3</li>
<li class="flex-item">4</li>
<li class="flex-item">5</li>
</ul>
Upvotes: 1
Views: 2933
Reputation: 411
just use a margin for the childs:
.flex-item {
margin: 0 10px;
}
to remove the space to the left and right of the container use first- and last-child selectors:
.flex-item:first-child{
margin-left: 0;
}
.flex-item:last-child{
margin-right: 0;
}
see http://jsfiddle.net/7yttrtm4/2/
or add negative margin to the container:
.flex-container {
margin: 0 -10px;
}
see: http://jsfiddle.net/7yttrtm4/4/
Upvotes: 1