The Container Block: The Box Every Section Is Built On

The section wrapper that decides where your blocks sit, how wide they run, and what colour the area behind them is — boxed or full-width, row or column, light or dark.

Every section starts with a box

You have a heading, a couple of paragraphs and a button, and you want them grouped into a tidy section — centered, on a soft background, with room to breathe. In plain WordPress that means a wrapper div, some max-width, padding, a background rule, and a media query so it doesn’t fall apart on a phone. All by hand, for every section.

The Container block is that wrapper, built in. It holds your other blocks and decides where they sit — boxed and centered or full-width, in a row or a column — and carries the background, padding and width for the whole area.

Switch a section between boxed — a centered column with a max width — and full-width, edge to edge
Arrange the blocks inside in a row or a column, aligned and spaced — and set it differently per device
Set the maximum content width, so text lines never stretch too wide to read comfortably
Give the section its own background, border and shadow, with separate light and dark colours — no media query
Plus padding, margins, a minimum height — and nesting: drop a Container inside a Container for cards within sections

You drop a Container in, put your blocks inside, and set it up from the sidebar: pick boxed or full-width, choose a row or a column, add a background and some padding. Change the layout for tablet and mobile from the same panel, and drop another Container inside for a card — no wrapper divs, no CSS.

See it work

A boxed section, centered with a max width. Its contents stay in a tidy column no matter how wide the screen.

A boxed section

Boxed keeps its contents in a centered column with a maximum width, so the lines never stretch too wide on a large screen.

Full width, filling the whole row. The same block set to stretch, with a gradient behind it.

A full-width section

Full width lets the section fill the whole row, so a banner or a coloured strip runs the entire width available to it.

A row on desktop, stacked on phones. The children sit side by side, then fall into a column when space runs out.

Text on one side, a button on the other

A taller section with centered content. A minimum height, with the blocks inside sitting in the middle.

Content, centered

Give a section a minimum height and center its contents, and short content sits comfortably in the middle instead of clinging to the top edge.

Ready to lay out your next section?

The Container block ships inside Flexa Block. Install the plugin and it’s waiting in your editor the next time you open a page.

More articles

Keep reading

Other guides from the Flexa Blocks library.

48 posts found