Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

CSS Grid Lanes samples

This directory contains sample pages showing how to use CSS Grid Lanes, also known as CSS Masonry.

Enable CSS Grid Lanes support in Chromium-based browsers

To test CSS Grid Lanes in Microsoft Edge, and other Chromium-based browsers, enable the feature:

  1. Use a the latest version of Microsoft Edge, or an other Chromium-based browser.

  2. Open a new tab or window, and go to the about://flags page.

  3. Enter CSS Grid Lanes Layout in the Search flags text box, at the top of the page.

    The list of flags is filtered to only show the CSS Grid Lanes Layout flag.

  4. Under the CSS Masonry Layout flag section, set the dropdown to Enabled.

  5. Restart the browser.

Samples

Sample Description Screenshot
New York City photos A photo gallery with explicit placement and lane spanning. Screenshot of the demo page.
News site - The Daily Oddity A news site layout with auto-placed, densely packed, articles, and column spanning. Screenshot of the demo page.
Kanban board A kanban board, with sticky notes explicitly placed in column lanes, combined with view transitions. Screenshot of the demo page.
Nature photos Nature photo gallery showcasing multiple column lane size options Screenshot of the demo page.
Blog A blog layout Screenshot of the demo page.
Scroll-triggered entry animation A photo gallery with scroll-triggered entry animations. Screenshot of the demo page.
Col.or Studies Artwork portfolio page with a dynamic layout. Screenshot of the demo page.
Infinite loading board Infinite loading text and photo board. Screenshot of the demo page.
Toggle layout direction A photo gallery with toggleable layout direction. Screenshot of the demo page.

Syntax examples

Example Description
Same size columns Use the grid-template-columns property to create a equal size column lanes.
Same size rows Use the grid-template-rows property to create a equal size row lanes.
Custom lane sizes Use the grid-template-columns and grid-template-rows properties to create custom sized lanes.
Intrinsic lanes Use `repeat(auto-fill, auto) to create lanes that are sized to fit their content.
Grid-lanes shorthand Use the grid-lanes shorthand property to set lane sizes, line names, and layout orientation in a single declaration.
Lane spanning Use grid-column or grid-row with the span keyword to make items span multiple lanes.
Flow tolerance Use the flow-tolerance property to find the right balance between even columns and DOM order preservation.

See also