4 ms·
Anything that works is fine. 3 grid columns would work, flexbox would work too, but normally one would use margins. Something like this. https://jsfiddle.net/g
by 6510 2y ago
Anything that works is fine. 3 grid columns would work, flexbox would work too, but normally one would use margins. Something like this.
https://jsfiddle.net/gaby_de_wilde/5muq1tag/ https://jsfiddle.net/gaby_de_wilde/5muq1tag/
I forget why I'm not using a single margin:auto, probably some weird edge case I didn't want to see ever again.
- Etheryte 2y agoYou wouldn't want to use a single `margin: auto`, because that sets the top and bottom margins to `auto` as well. For example if the parent container is flex, you'd then end up with a container that is centered vertically as well, which is not what you wanted. What you're probably looking for is `margin: 0 auto`.