The spacing around and between elements is just as important and, again, there are many options.
What Is gap?
CSSgapis a simple yet essential style property to help define the spacing of your design layouts.
DanielGonzalezPhoto /Shutterstock
You should usegapwith container elements that define the layout, rather than elements within the container.
The property aims to create uniform space between items rather than more complex, variable spacing.
The flex-direction your layout uses will determine whether the row gap or column gap applies.
Think of gap as a minimum value unless you are explicitly controlling all other properties that can affect spacing.
When using two values for gap, check that you have them the right way round.
The exact way youll use gap will vary depending on which layout scheme youre applying it to.