HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Set the gap between rows and columns to 50px
The gap
property defines the size of
the gap between the rows and columns. It is a shorthand for the
following properties:
gap
property was formerly known as
grid-gap
.
Default value: | normal normal |
---|---|
Inherited: | no |
Animatable: | yes. Read about animatable Try it |
Version: | CSS Box Alignment Module Level 3 |
JavaScript syntax: | object.style.gap="50px 100px" Try it |
The numbers in the table specify the first browser version that fully supports the property.
Property | |||||
---|---|---|---|---|---|
gap (in Grid) | 66 | 16 | 61 | 12 | 53 |
gap (in Flexbox) | 84 | 84 | 63 | 14.1 | 70 |
gap (in Multiple Columns) | 66 | 16 | 61 | Not supported | 53 |
Value | Description | Demo |
---|---|---|
row-gap | Sets the size of the gap between the rows in a grid layout | Demo ❯ |
column-gap | Sets the size of the gap between the columns in a grid layout | Demo ❯ |
Set the gap between rows to 20px, and the columns to 50px:
.grid-container {
gap: 20px 50px;
}
CSS tutorial: CSS Grid Layout
CSS reference: The row-gap property
CSS reference: The column-gap property