Skip to main content
CSSpeek

Typography Inspector – How to Audit Website Fonts Like a Designer

CSS Layout and Spacing Guide

Quick Answer

  • A box model inspector displays the content width, height, padding, border and margin of a website element.
  • Padding controls internal spacing, while margin controls external spacing around an element.
  • The box-sizing property determines whether padding and borders are included in the declared width and height.
  • Inspecting both an element and its parent helps identify unexpected gaps, overflow and inconsistent alignment.
  • Use the free CSSPeek box model inspector to examine element dimensions and spacing through a focused visual panel.

A box model inspector helps you understand exactly how much space a website element occupies. Whether you are reviewing a button, fixing an oversized card or investigating an unexpected gap, inspecting the box model reveals the CSS values responsible for its appearance.

This guide explains how to inspect margin, padding, width and height using CSSPeek, calculate actual element dimensions and troubleshoot common website spacing problems.

What Is a Box Model Inspector?

A box model inspector is a browser inspection tool that visualises the rectangular layout areas surrounding an HTML element. It separates content dimensions from padding, borders and margins, making it easier to identify where space originates.

Unlike measuring a screenshot, live inspection reveals the CSS properties applied by the browser. Designers can use this information to compare components and developers can investigate unexpected layout behaviour.

CSSPeek brings these measurements together with typography, selectors and other visual properties. This is particularly useful when a layout problem involves multiple styling decisions rather than one incorrect spacing value.

For a broader understanding of element inspection, explore our CSS properties viewer guide.

Understanding the Four Layers of the CSS Box Model

The CSS box model consists of four areas that determine how elements occupy space within a webpage.

Margin 16px

Border 2px

Padding 20px

Content

240 × 100px

Illustrative box model diagram with example measurements. The visual proportions are not drawn to scale.

Content Width and Height

The content area contains text, images or other child elements. Its dimensions depend on the applicable sizing rules and surrounding layout.

Padding

Padding creates space between the content and its border. Increasing button padding, for example, can create a larger clickable area without changing the text size.

Border

The border surrounds the padding and content areas. Its thickness contributes to the border-box dimensions of an element.

Margin

Margin creates external spacing around an element. Unlike padding, it does not extend the element's background and may interact with adjacent margins under certain layout conditions.

The official MDN CSS box model documentation explains these layout areas and their sizing behaviour.

How to Inspect the CSS Box Model Using CSSPeek

CSSPeek provides a focused inspection workflow for reviewing spacing and dimensions directly on supported webpages.

Step 1 Install the CSSPeek Extension

Visit the CSSPeek website and install its Chrome extension. Open the webpage containing the component you want to inspect.

Step 2 Select the Exact Website Element

Activate CSSPeek and click the target element. Select the button or card itself rather than its inner text to capture the relevant component dimensions.

Step 3 Read the Box Model Measurements

Review the content dimensions and spacing values on all four sides. Check whether the element uses consistent horizontal and vertical padding or has unexpected individual offsets.

Step 4 Inspect the Parent Container

If the selected element has no unusual spacing, inspect its parent. The visible gap may originate from container padding, flexbox or grid gap rather than the selected element's margin.

Step 5 Compare and Document Similar Components

Inspect another component serving the same purpose. Record differences in size, padding, border thickness and box sizing before recommending changes.

Explore our website spacing and visual properties inspection guide to extend this workflow beyond individual boxes.

Content Box vs Border Box and How Element Size Is Calculated

The box-sizing property determines how declared width and height interact with padding and borders. Understanding it helps explain why a component may appear wider than expected.

Measurement Content Box Border Box
Declared width 300px 300px
Horizontal padding 40px 40px
Horizontal borders 4px 4px
Content area width 300px 256px
Border-box width 344px 300px
Horizontal margins 32px 32px
Horizontal margin-box width 376px 332px

Illustrative CSSPeek calculation model assuming fixed dimensions and no additional layout constraints.

Content Box Width Formula

Border-box width = Declared width + Horizontal padding + Horizontal borders

300 + 40 + 4 = 344px

Border Box Width Formula

Content width = Declared width − Horizontal padding − Horizontal borders

300 − 40 − 4 = 256px

Margins remain outside the declared border-box width. The same sizing principles apply to height when an explicit height is defined and other layout constraints do not override it.

Practical CSS Box Sizing Example

CSS Box Model Example
.card {
  box-sizing: border-box;
  width: 300px;
  max-width: 100%;
  padding: 20px;
  border: 2px solid #cbd5e1;
  margin: 16px;
}

The card includes its padding and borders within the declared width. Its external margin still needs to be considered when fitting the component inside a narrow container.

Inspect Website Spacing Without Guesswork

View content dimensions, padding, borders, margins and box sizing directly on live webpages with CSSPeek. Understand how components occupy space before making layout changes.

Install CSSPeek Free

How to Debug Common Website Spacing Problems

A useful box model audit connects visible layout problems with specific CSS properties. Use the following troubleshooting matrix to determine what to inspect first.

Visible Problem Inspect First Possible Solution
Unexpected space between cards Margin and parent gap Remove unintended overlapping spacing rules
Text touches card edges Padding Introduce suitable internal spacing
Element exceeds container width Width, box sizing and minimum width Adjust sizing rules and available space
Uneven button heights Padding, border and line height Standardise shared component styles
Unexpected vertical spacing Adjacent block margins Investigate margin collapsing
Horizontal scrolling on mobile Fixed widths and child overflow Test responsive sizing and wrapping

Margin Collapsing and Unexpected Vertical Gaps

Under normal block layout conditions, adjoining vertical margins can collapse. Two adjacent positive margins of 24px and 16px may therefore produce a 24px gap rather than 40px.

Flexbox and grid item margins do not collapse in the same way. Inspect the parent layout before changing individual spacing values.

Flexbox and Grid Gap vs Margin

The gap property creates spacing between items in supported layouts. If an element shows zero margin but visible space remains between neighbouring items, inspect the parent container's gap and alignment properties.

For deeper investigation, follow our Chrome CSS inspection guide to identify the rules responsible for the final layout.

How to Inspect Responsive Width and Height

An element that fits correctly on desktop may overflow on mobile. Inspecting a single screen size cannot reveal every responsive layout issue.

Use CSSPeek alongside browser viewport testing to compare component dimensions at different screen widths.

Example Viewport Horizontal Page Padding Available Content Width
1440px desktop 64px 1376px
768px tablet 48px 720px
375px mobile 32px 343px

Illustrative calculations assuming full-width containers without additional margins, borders or scrollbar deductions. These are not mandatory responsive breakpoints.

A fixed 360px component would exceed the example mobile content area by 17px before accounting for external spacing. Review fixed widths, minimum sizes and child content before hiding overflow.

How to Build a Consistent Website Spacing System

Repeated spacing inconsistencies often indicate that a website lacks shared design tokens. Inspect several cards, buttons and sections to identify recurring measurements.

The CSSPeek Site Style Report can extract recurring padding, margin and gap values from accessible stylesheets. Combine this overview with live element inspection to identify values that are actually applied.

Example Reusable CSS Spacing Tokens

CSS Spacing System
:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
}

.product-card {
  box-sizing: border-box;
  padding: var(--space-6);
}

.card-grid {
  display: grid;
  gap: var(--space-4);
}

This illustrative spacing scale creates reusable values without requiring every component to use identical dimensions. Select tokens based on actual design requirements and component behaviour.

CSSPeek Box Model Inspector vs Chrome DevTools

CSSPeek simplifies visual spacing inspection, while Chrome DevTools supports deeper layout investigation and temporary CSS editing.

Feature CSSPeek Chrome DevTools
Box model visualisation Focused inspection panel Interactive box model diagram
Spacing inspection Direct element selection Elements and Computed panels
Live CSS editing Inspection focused Supported
Layout investigation Visual properties and dimensions Grid and flexbox debugging
Best use case Quick visual spacing audits Detailed technical debugging

How to View the Box Model in Chrome DevTools

  1. Right-click the target website element and select Inspect.
  2. Locate the selected element in the Elements panel.
  3. Open the Computed tab or locate the box model diagram in the available sidebar.
  4. Review the dimensions, padding, borders and margins.
  5. Test temporary CSS changes when necessary.

The official Chrome DevTools CSS reference provides additional inspection and editing instructions.

For designers who prefer a focused inspection interface, our guide to Chrome DevTools alternatives for CSS inspection explains how both workflows complement each other.

Website Box Model and Spacing Audit Checklist

  • Inspect the correct component rather than its inner text.
  • Record content width and height.
  • Compare padding and margins on all four sides.
  • Verify border thickness and box sizing.
  • Inspect parent container padding and gap.
  • Check for unexpected margin collapsing.
  • Review fixed dimensions and responsive constraints.
  • Compare repeated components across page templates.
  • Retest affected layouts after implementing changes.

Combine these checks with our website design audit checklist when conducting a complete interface review.

Frequently Asked Questions

What Is a CSS Box Model Inspector?

A CSS box model inspector displays the content dimensions, padding, borders and margins of a selected website element to help identify layout and spacing properties.

How Can I Inspect Margin and Padding on a Website?

Install CSSPeek, activate the inspector and select the target element. Its box model panel displays available margin, padding, border and dimension values.

What Is the Difference Between Margin and Padding?

Padding creates internal space between content and borders. Margin creates external space around the element.

Does Border Box Include Margin?

No. The border-box area includes content, padding and borders. Margin remains outside this area.

Why Is an Element Wider Than Its CSS Width?

Content-box sizing can add padding and borders to the declared width. Minimum sizes, parent layout rules and other CSS constraints can also affect the final dimensions.

Is CSSPeek a Free Box Model Inspector?

Yes. CSSPeek provides a free Chrome extension for inspecting box model dimensions, typography, colours and other visual CSS properties on supported webpages.

Can I Inspect the Box Model Without Writing CSS?

Yes. CSSPeek lets users select visible website elements and read their available box model properties without writing CSS.

Final Thoughts on CSS Box Model Inspection

A reliable box model inspection workflow helps designers understand where spacing originates and gives developers measurable information for resolving layout problems.

CSSPeek brings essential dimensions and visual CSS properties into one focused interface, making it easier to evaluate components, compare spacing patterns and document design improvements directly from live websites.

Start Inspecting Website Box Models With CSSPeek

Check margin, padding, width, height, borders and other visual CSS properties directly in your browser. Make more informed layout decisions with a focused inspection tool built for designers and developers.

Get CSSPeek Free