HTML Diff
0 added 0 removed
Original 2026-01-01
Modified 2026-03-09
1 <p>We do not always need the equal spacing between rows and columns. In these cases the column-gap and row-gap properties can come to our rescue.</p>
1 <p>We do not always need the equal spacing between rows and columns. In these cases the column-gap and row-gap properties can come to our rescue.</p>
2 <p>As you might have already guessed, the first property sets the spacing between columns, and the second sets the spacing between rows.</p>
2 <p>As you might have already guessed, the first property sets the spacing between columns, and the second sets the spacing between rows.</p>
3 .grid { row-gap: 20px; /* Grid spacing between rows */ column-gap: 50px; /* Grid spacing between columns */ }<p>In fact, we can use the gap property to assign spacing separately to columns and to rows. If you assign not just one, but two values to gap, the first will determine the spacing between the rows and the second will determine the spacing between columns. The second value is separated by a space from the first value:</p>
3 .grid { row-gap: 20px; /* Grid spacing between rows */ column-gap: 50px; /* Grid spacing between columns */ }<p>In fact, we can use the gap property to assign spacing separately to columns and to rows. If you assign not just one, but two values to gap, the first will determine the spacing between the rows and the second will determine the spacing between columns. The second value is separated by a space from the first value:</p>
4 .grid { /* Grid spacing between rows of 20px, Grid spacing between columns of 50px */ gap: 20px 50px; }<p>The column-gap and row-gap properties were previously called grid-column-gap and grid-row-gap, respectively. Like gap, they have been renamed and are now used with more than just grids.</p>
4 .grid { /* Grid spacing between rows of 20px, Grid spacing between columns of 50px */ gap: 20px 50px; }<p>The column-gap and row-gap properties were previously called grid-column-gap and grid-row-gap, respectively. Like gap, they have been renamed and are now used with more than just grids.</p>