Answer the question
In order to leave comments, you need to log in
Flexbox - What is the best way to set the margin from the edge of the container?
Google did not give an answer (maybe I did not search well).
I have a flex container with n flex items.
I need to set the padding from the edge of the container with one value, and between the elements - the padding with a different value.
I found 2 ways, but I don’t know which of these methods is still correct (and which are underwater for each method).
Code examples below:
https://jsfiddle.net/vgoejckd/ (padding set using padding on container)
https://jsfiddle.net/qzvje0uf/ (padding set using margin on elements)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question