Here’s what I’m trying to accomplish. I want some padding left and right but then I don’t want the items themselves to appear centered.
I have a container as follows:
.container {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
My question is how do I add padding so that on the rows there’s some space left and right in the container?
2
Answers
If I understood your question correctly, I think you just need to add horizontal padding:
You should sue grid for this but works the same for flexbox.
padding
only works on the inside and does nothing with the valueauto
. What you actually need is to simply add a margin to the outside:margin: 0 auto