New and Updated Properties for Layout and Scroll Behavior

Learn about properties that enhance the options for controlling layouts and how users can scroll a page.

The gap property

The gap property is now supported for both grid and flexbox. The gap shorthand property allows setting a “gap” of space between flex and grid children. A gap is only ever applied between children, not around them, which makes it different from applying margin. While gap has been available for grid since its inception, support for flexbox gap was lagging behind until it landed in Safari in April 2021, resulting in cross-browser compatibility.

Get hands-on with 1200+ tech skills courses.