Sub topic 7
Lay out a grid with fixed margins
This chapter assumes you can create frames, guides, and auto-layout or alignment settings in a design tool such as Figma, Canva, or Illustrator. It also assumes you have already picked your platform formats and have the color and type tokens from earlier chapters. Here you will build the grid that holds those pieces in the same place on every graphic.
What a grid does for a series
A grid is a set of invisible guides: margins, columns, gutters, and sometimes rows. Every element you place snaps to those guides. In a series, this has two effects.
- Viewers see the same logo, headline, and body text in the same places from post to post. That repetition is much of what makes the series recognizable.
- You make fewer layout decisions. Instead of asking "where should this go?", you ask "which columns does this span?"
Fixed margins are the most important part. If the margin changes from graphic to graphic, the series looks uneven even when colors and fonts match.
The parts of the grid
| Part | What it is | Typical choice for a 1080 px wide canvas |
|---|---|---|
| Margin | Empty border between the canvas edge and the content | 80 px on all sides (about 7% of the width) |
| Column | A vertical strip that content aligns to | 4 or 6 columns |
| Gutter | The gap between two columns | 16 to 24 px |
| Spacing unit | The base number all gaps are multiples of | 8 px |
| Zone | A named vertical band, such as header or footer | Defined per template |
Margins and gutters do different jobs. The margin keeps content away from the edge, where platforms crop and rounded corners cut off text. The gutter keeps neighboring blocks from touching.
Step 1: Fix the margin first
Choose one margin value per canvas size and write it down as a token. The chapter's sample token set uses --margin: 80px, and the template spec uses "margin": 80. Keep those two numbers identical so a designer and a developer, or you and a plugin, never disagree.
Pick a margin large enough to survive cropping and small enough to leave room for content. For a 1080 px canvas, 60 to 90 px is the usual range. Once you choose, do not shrink it to fit one more line of text. Shorten the text.
Step 2: Choose a column count
Calculate the content width first: canvas width minus two margins. Then choose a column count that divides cleanly.
- 4 columns suit simple layouts: a headline, one image, one caption.
- 6 columns give more options. You can split the width into 2+4, 3+3, or 2+2+2.
- 12 columns are common on the web but rarely needed on a 1080 px graphic. With narrow columns, you end up with many alignment options and little discipline.
Prefer a column width that is a whole number of pixels. Fractional widths (such as 133.33 px) cause blurry edges after export and make guides hard to reproduce.
The formula is:
column width = (canvas width - 2 × margin - (columns - 1) × gutter) / columnsFor a 1080 px canvas with an 80 px margin, 6 columns, and a 16 px gutter, that gives (1080 − 160 − 80) / 6 = 140 px per column.
Step 3: Compute the guides in code
You can calculate guide positions by hand, but a short script avoids arithmetic errors and flags layouts that produce fractional columns. This script prints the x position of each column and the rectangle for any block that spans several columns.
def grid(width, margin, count, gutter):
"""Return (column_width, [x position of each column])."""
usable = width - 2 * margin - (count - 1) * gutter
col = usable / count
if col != int(col):
raise ValueError(f"Column width {col:.2f}px is not a whole number")
col = int(col)
return col, [margin + i * (col + gutter) for i in range(count)]
def span(width, margin, count, gutter, start, n):
"""Return (x, block_width) for a block spanning n columns from column `start`."""
col, xs = grid(width, margin, count, gutter)
return xs[start], n * col + (n - 1) * gutter
col, xs = grid(1080, 80, 6, 16)
print("column width:", col)
print("column x positions:", xs)
print("headline, all 6 columns:", span(1080, 80, 6, 16, 0, 6))
print("body text, first 4 columns:", span(1080, 80, 6, 16, 0, 4))
print("photo, last 2 columns:", span(1080, 80, 6, 16, 4, 2))Running it prints a column width of 140, column positions [80, 236, 392, 548, 704, 860], and these blocks: the headline at x=80 with width 920, the body at x=80 with width 608, and the photo at x=860 with width 296. The last column ends at 860 + 140 = 1000, which is exactly 80 px from the right edge. That confirms the margins are symmetrical.
If you change the numbers to a combination that does not divide evenly, the script raises an error. That is the intended behavior. Adjust the gutter or margin by a few pixels until it passes.
Step 4: Add vertical structure
Columns control horizontal alignment. Vertical alignment needs its own rules, and the simplest approach is named zones rather than many rows.
For a 1080×1350 canvas with an 80 px margin, the content area runs from y=80 to y=1270. A common split is:
- Header zone: the top 120 px of the content area, for the logo or series label.
- Main zone: the middle, for the headline and the image or key figure.
- Footer zone: the bottom 120 px, for the handle, page number, or "swipe" cue.
Use your spacing unit (8 px) for all gaps between blocks: 16, 24, 32, 48, and so on. Because the canvas height of 1350 is not a multiple of 8, do not try to divide the full height evenly. Anchor the header to the top margin and the footer to the bottom margin, and let the main zone absorb the remainder.
Adapting the grid to other formats
You will usually publish more than one format. Keep the same margin and gutter values across formats. Change only what the format forces you to change.
| Format | Canvas | Grid approach |
|---|---|---|
| Square | 1080×1080 | Same 80 px margin, 6 columns. The main zone is shorter, so allow fewer text lines. |
| Portrait feed (4:5) | 1080×1350 | The reference layout in this chapter. |
| Story or vertical video (9:16) | 1080×1920 | Same side margins. Add extra top and bottom margins for interface overlays. |
Platforms place buttons, captions, and profile elements over the top and bottom of vertical formats. Commonly recommended safe zones leave roughly 250 px at the top and bottom of a 1080×1920 canvas, but the exact numbers change when platforms update their apps. Check the current platform guidance and record the values you choose in your template spec rather than relying on memory.
Feed previews can also crop a graphic. A profile grid may show a different crop than the full post. Keep the headline and logo inside the center area of the canvas so a crop does not cut them off.
Recording the grid in the template spec
Add the grid to the same template spec that lists fixed and variable elements. This turns the grid from a habit into a rule.
{
"template": "quote-card",
"canvas": { "width": 1080, "height": 1350 },
"margin": 80,
"grid": { "columns": 6, "gutter": 16, "columnWidth": 140 },
"zones": {
"header": { "y": 80, "height": 120 },
"footer": { "y": 1150, "height": 120 }
},
"fixed": ["logo position", "background color", "title font", "margin", "grid"],
"variable": ["headline text", "accent color (from palette)", "photo"]
}The footer zone starts at y=1150 because the content area ends at 1270 and the footer is 120 px tall.
Common errors
- Changing the margin to fit text. The fix is to edit the copy or reduce the type size within your type scale.
- Aligning to the eye instead of the guides. An element that is 3 px off looks careless when two slides are viewed side by side, especially in a carousel.
- Using fractional column widths. They produce soft edges and make guides hard to share between tools.
- Ignoring the canvas center. Text that hugs a margin looks fine on the canvas and gets cropped in a preview.
- Building the grid on one slide and copying it by hand. Put the guides in the master template or component so a change updates every slide.
Check your understanding
Exercise
A series uses a 1080 px wide canvas with a 60 px margin, 4 columns, and a 20 px gutter. What is the column width, and is it a usable value? What is the x position of the third column?
Show answer
Usable width is 1080 − 2×60 − 3×20 = 900, so each column is 900 / 4 = 225 px, a whole number, so it is usable. The third column starts at 60 + 2×(225 + 20) = 550 px.
Exercise
A teammate shrinks the margin from 80 px to 40 px on one slide so a long headline fits on two lines. Name two problems this causes in a series and one better fix.
Show answer
The slide's content sits closer to the edge, so it is more likely to be cropped by a platform preview, and its layout no longer matches the other slides, which breaks the series' consistency (this is most visible in a carousel). A better fix is to shorten the headline or use a smaller step in the type scale while keeping the 80 px margin.