Skip to main content
/
/
/
Grid

Grid

Create a responsive column layout

ReactCSS

The .bfl-grid class applies a CSS Grid with a single column, and 12px gap between rows.

Element
Element

Columns

You can configure number of columns (default 1) through the --bfl-columns custom property.

Two columns for all screens

Inline style

Element
Element

CSS selector

Element
Element

One column up to 600px, three for wider

Element
Element
Element

Two columns up to 960px, four for wider

Element
Element
Element
Element

Span columns

You can use grid-column: span [number] to span multiple columns.

Element
This content spans two columns for 600px screens and wider

Span rows

You can use grid-row: span [number] to span multiple rows, depending on the order of the elements in the DOM.

Element
This content spans two rows for 600px screens and wider
Element

Custom gap

You can configure the gap spacing (default 12px) through the --bfl-gap custom property.

Element
Element

Custom positioning

If re-arranging the DOM structure isn't feasible you can combine grid-row and grid-column to place an element anywhere you want. All other elements will be placed in other unoccupied areas of the grid by default.

Read more about css grid terminology.

Element
Element
Element
For 600px+ this content spans three rows, and is placed as last element in the DOM. For mobile screens it will appear at the bottom.

Combined gap and column span

Gap and column span can be combined together.

Element
This content spans two columns for 600px screens and wider