CSS: gap (flex)

By Xah Lee. Date: .

gap

gap (Spacing Between Items)

The gap property is a shorthand for row-gap and column-gap.

they add space between the items, but does not actually add margin of the items.

gap: length

gap for between rows and between columns.

1
2
3
4
5
6
row-gap: length

the spacing between rows, in multi-column, flex, and grid containers.

1
2
3
4
5
6
column-gap: length

the spacing between columns, in multi-column, flex, and grid containers..

1
2
3
4
5
6

CSS, flex layout