CODE & CLONING

How to measure spacing on a website

Open Sitepeel’s Inspect & measure tool, check the container first and then its children, and note which padding, margin and gap values repeat.

Outer margin, inner padding and the gap between siblings are shown as different spaces.
Measure the right relationship before turning distances into layout rules.

In short

  • Work from the outside in: container first, then children
  • Padding, margin and gap can create the same-looking space
  • Repeated values suggest a spacing scale; one-offs usually don’t
  • Measure again at a second width
On this page5
  1. Step by step
  2. Padding, margin, border and gap
  3. Find the spacing scale
  4. Check it at another width
  5. Questions

Step by step

  1. Open Inspect & measure

    Open Sitepeel and choose Inspect & measure on the page.

  2. Start with the container

    Note its width and the space between its edge and the first child.

  3. Inspect the children

    Check each child’s size, padding and margin, and the gap set by the parent layout.

  4. Compare repeated parts

    Measure several cards or sections. Values that repeat suggest a spacing scale.

  5. Check another width

    Resize the page and measure the same section again.

Padding, margin, border and gap

Similar distances can come from different rules, so inspect the parent layout as well as the element.

The kinds of space in a CSS layout
SpaceWhere it sits
PaddingInside the border, around the content
BorderBetween the padding and the margin
MarginOutside the border, separating boxes
GapBetween the children of a flex or grid parent
CSS inspector & ruler in the Sitepeel interface
CSS inspector & ruler in actionExplore the tool

Find the spacing scale

A single 19-pixel gap may come from font metrics or rounding; repeated 16- and 24-pixel spaces are stronger clues. Keep relationships, not every measurement: a small label gap, a larger section gap, consistent card insets.

spacing.cssCSS
:root {
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
}
/* Example scale: adjust after reviewing your actual layout. */

Check it at another width

A fluid layout can keep its hierarchy while its distances change. Build the relationship you want, then test it with longer text and larger text settings.

Questions

What is the difference between padding and margin?

Padding is space inside an element’s border, around its content. Margin is space outside the border that separates it from other elements.

Are measurements the same on every screen?

No. Viewport width, fonts and responsive CSS change the layout. Measure at the widths your project needs.

Can it replace browser developer tools?

It’s a focused visual way to inspect and measure. Use developer tools for deeper debugging, JavaScript or network inspection.

TAKE A CLOSER LOOK

Your next starting point is already on the web.

Inspect it. Understand it. Build something of your own.

Add to ChromeFree installTry the free tools