Level 3 of the CSS Grid Layout specification includes a masonry
value for grid-template-columns
and grid-template-rows
. This guide details what masonry layout is, and how to use it.
Warning: This feature is only implemented in Firefox, and can be enabled by setting the flag layout.css.grid-template-masonry-value.enabled
to true
in about:config
, in order to allow testing and providing of feedback.
Masonry layout is a layout method where one axis uses a typical strict grid layout, most often columns, and the other a masonry layout. On the masonry axis, rather than sticking to a strict grid with gaps being left after shorter items, the items in the following row rise up to completely fill the gaps.