Elementor 101 · Lesson 04

Layouts with Div block, Flexbox and Grid

How Atomic layout elements nest, when to pick Flexbox or Grid, and a hero section built step by step.

  • ⏱ ~18 min
  • Beginner
  • 6 steps + quiz
  • Works with free Elementor

Written for Elementor 4.3.3 · Elementor Pro 4.3.1 · Updated October 2026

01Every layout is boxes inside boxes

Forget sections and columns. In Elementor 4 a page is made of layout elements that hold other elements, and they can nest as deep as you need. There are three:

ElementArranges childrenUse it for
Div blockNormal flow (one after another)A simple wrapper, such as a card or a text group.
FlexboxIn a row or a column, with alignment and gapHero sections, navigation, button groups, anything one-directional.
GridIn rows and columns at onceCard grids, feature lists, galleries, pricing tables.

02Flexbox: direction, alignment and gap

Drag a Flexbox onto the canvas and put three Buttons inside it. Then open Style › Layout:

Direction: row
Direction: column
Justify: space-between
Fig. 1 — The same three children with different Flexbox settings.
  • Direction: row (side by side, the default) or column (stacked).
  • Justify content: where children sit along the direction (start, center, end, space-between).
  • Align items: where they sit across it, for example vertically centred in a row.
  • Gaps: the space between children, as a column and a row value that start linked. Use it instead of margins on each child.
  • Wrap: allow items to move to the next line when they run out of room.
Style tab, Layout section of a Flexbox: Display, Direction set to column, Justify content, Align items set to start, and 16 px gaps; the hero on the canvas stacks heading, paragraph and button
Fig. 2 — A Flexbox set to column, align items start, gaps 16 px. The dot next to a label means the value was changed.

03Grid: columns that line up

When things need to line up both across and down, as in a card grid, use Grid. A new Grid starts with 3 columns, 2 rows and a 20 px gap, so a card grid is ready as soon as you drop it in.

Style tab, Layout section of a Grid: Show Grid Outline on, Columns 3 fr, Rows 2 fr, Auto flow, 20 px gaps; six cards on the canvas in three columns
Fig. 3 — Six cards in a 3 × 2 Grid. Every card lines up with its neighbours.
  1. Drag in a Grid. In Style › Layout, set Columns and Rows to the numbers you need.
  2. Drop a Div block in each cell for the cards, then put a Heading and Paragraph inside each card.
  3. Set Gaps once on the Grid. Every card gets the same spacing.
  4. Switch to tablet and set 2 columns, then switch to mobile and set 1. The cards reflow automatically.

04Build it: a simple hero section

Put it together. This is the structure behind most hero sections, including the ones in the Katka templates:

  • Flexbox — "Hero" · row · align center · gap 48
    • Flexbox — "Hero text" · column · gap 16
      • Heading (h1)
      • Paragraph
      • Flexbox — "Buttons" · row · gap 12
        • Button
        • Button
    • Image
Fig. 4 — Hero structure as it appears in the Structure panel (names are yours to set).
  1. Add the outer Flexbox. Set the direction to row, align items to center and the gap to 48 px. Give it padding of about 80 px top and bottom.
  2. Inside it, add a column Flexbox for the text and an Image next to it.
  3. Fill the text column with a Heading (set the tag to h1), a Paragraph and a row of two Buttons.
  4. Switch to mobile and set the outer Flexbox to column. The image drops under the text.
  5. Rename each layout element in Structure. In two weeks, "Hero text" will mean more to you than "Flexbox".

05Content width and spacing basics

Two habits keep layouts clean:

  • Limit width on an inner box, not the page. Keep the outer box full-width (for the background), and give an inner box a Max width such as 1200 px, with automatic left and right margins to centre it.
  • Padding on parents, gap between children. Avoid adding margin to every element. It's the main reason layouts drift on mobile.

06Common mistakes

  • Using Flexbox for card grids. Cards with different text lengths stop lining up. Use Grid when there are both rows and columns.
  • Nesting "just in case". Every extra box is one more thing to style and select. Add a wrapper only when it does a job.
  • Fixed heights. A fixed height looks fine until the text gets longer or the screen gets narrower. Let content set the height, and use min-height if you need a floor.

✓Quick quiz

Three questions to check the essentials. Get them all right to complete the lesson.

1. Which element is best for a 3×2 grid of feature cards?
2. What is the cleanest way to space buttons inside a Flexbox?
3. On mobile you want the hero image under the text. What do you change?