Skip to content

Grids and cards that don’t line up

When a grid ends with one item alone on its last row, cards in a row have different heights or buttons at different heights, its images have different shapes, or a box sits inside another box, the page looks unfinished.

Why it matters

Visitors compare cards side by side, so every step and gap draws the eye away from what the cards say.

How to fix it

  1. Fill the last row of each grid, or change the number of columns so it comes out even: six items in three columns, not seven.
  2. Make the cards in a row the same height with each card’s button at the bottom, and crop their images to one shape, such as square or 4:3.
  3. Where a card sits inside another box, remove the inner card’s border or shadow.
On WordPress
  1. Select the Gallery block and set Columns so the last row is full.
  2. Set Aspect ratio to one shape, such as Square.

WordPress help: Customize gallery settings (opens in a new tab)

On Shopify
  1. In the theme editor, click the section with the grid and set Columns so the last row is full.
  2. Set its images to one ratio, such as Square.

Shopify help: Customizing sections in the theme editor (opens in a new tab)

On Wix
  1. Click the gallery, click Settings and choose Grid in the Layout tab.
  2. Click Customize Layout, set Thumbnail resize to Crop, choose Set items per row and set Images per row so the last row is full.

Wix help: Choosing a layout (custom vs. presets) (opens in a new tab)

On Squarespace
  1. Click Edit Section on the gallery section and choose Grid: Simple in Gallery Type: images in even rows and columns.
  2. Below Gallery Type, set the number of columns so the last row is full.

Squarespace help: Gallery sections (opens in a new tab)

On Hostinger
  1. Click the gallery, click Edit gallery and choose the grid layout, which shows every image as a square.
  2. Set the number of images per row so the last row is full.

Hostinger help: How to add an image gallery in manual mode (opens in a new tab)

On Webflow
  1. Select the grid and, in the Style panel, change the number of columns so the last row is full.
  2. In the Style panel’s Size section, set each image’s Ratio to one shape, such as Square, and its Fit to Cover.

Webflow help: CSS width and height (opens in a new tab)

In code (HTML, CSS or Tailwind)
  1. Set the columns so the last row fills: grid-template-columns: repeat(3, 1fr) for six items (Tailwind grid-cols-3). Items in a grid row stretch to the same height.
  2. Make each card a column with its button pushed to the bottom, and crop its image to one shape. In Tailwind: flex flex-col on the card, mt-auto on the button, aspect-4/3 w-full object-cover on the image.
    .card { display: flex; flex-direction: column; }
    .card .button { margin-top: auto; }
    .card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }

MDN: aspect-ratio (opens in a new tab)

Check your fix

Once the change is live, check the page again.

Sources

Last checked 3 December 2026

Want it done for you?

We’re a product design studio. We can make this fix, and check the rest of your site while we’re at it.

Book a call (opens in a new tab)