G
G
GGwpAiushtha2019-09-10 19:04:35
css
GGwpAiushtha, 2019-09-10 19:04:35

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

1 answer(s)
L
lamer350, 2019-09-10
@GGwpAiushtha

https://jsfiddle.net/7qjs4bgd/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question