Website profiles · Technology insights · Alternatives

whatunit.com

No paid content found
Visit website
Profile views 7 Outbound visits 3 Normal
What CSS length unit should you use? Full homepage screenshot

At a glance

Category
Development
Language
English
Paid-content signal
No paid content foundObserved
Registered
2023
Hosting
NetlifyInferred
HTTPS certificate trusted
PassedObserved
Last updated

Website review

This review may include AI-generated content and is not individually verified. Domain, certificate and other facts come from the observed data on this page.

What is What CSS length unit should you use?

What CSS length unit should you use? is a single-purpose decision aid: an interactive flowchart that walks you through picking a CSS length unit. Instead of listing units in prose, it asks you to follow branches until you land on a recommendation, which suits developers who already know the options and just want a quick tiebreaker.

How it works in practice

The page centers on one flowchart. You click and drag to pan around it and use ctrl/cmd plus the mouse wheel to zoom, so it behaves like a small canvas rather than a scrolling article. There is no long explanation alongside it — the value is in the branching logic itself.

When it helps, and when it doesn't

It fits a concrete scenario: you are styling a component, you are unsure whether a value should be relative or fixed, and you want a consistent rule rather than a gut call. It is less useful if you are new to CSS lengths entirely, because a flowchart tells you what to choose but not why each unit behaves the way it does, and it won't cover every edge case in your layout.

A practical next step

Use the chart to reach a decision, then verify it against your actual constraints — how the value should respond to user font-size settings, container size, or viewport changes. If the chart's answer conflicts with how your layout scales, trust the layout and note the exception. For deeper background on individual units, official references such as MDN Web Docs are the better companion.

How do I choose the right CSS length unit for my project?

Choosing a CSS length unit comes down to one question: should this value scale with the user's font settings, with the viewport, or stay fixed? What CSS length unit should you use? answers it as an interactive flowchart you can pan and zoom, so you follow decision branches rather than reading a long table.

Quick decision guide

  • Text and spacing that should respect user preferences: relative units such as rem (root font size) or em (parent font size). rem keeps sizing predictable across nested components; em compounds, which is useful for padding that scales with its own component's text.
  • Layout that should adapt to the screen: viewport units (vw, vh, dvh, svh) or percentages. Watch out for mobile browser chrome — dynamic viewport units exist precisely because vh can misbehave when toolbars show and hide.
  • Borders, hairlines, and other near-fixed details: px is still reasonable, because a 1px border is meant to look like a 1px border.
  • Container-driven components: container query units (cqw, cqi) when a component should scale with its container, not the viewport.

A concrete scenario

You are building a card component used in both a narrow sidebar and a wide hero section. If you size its padding in vw, it will look bloated in the hero and cramped in the sidebar. Sizing in rem ties it to user font preferences, which is safer. If the card truly must scale with its slot, container query units are the better fit. That trade-off — user preference versus layout context — is exactly the kind of branch a flowchart handles well.

Next step

Open the flowchart and trace your own case: start from "is this text, spacing, or layout?" and follow the branches to a unit. Then test the result by changing your browser's default font size and resizing the window; a good unit choice survives both.

What are the differences between absolute and relative CSS length units?

Absolute units (px, cm, mm, in, pt, pc) map to a fixed physical or device size, so they stay the same regardless of context. Relative units (em, rem, %, vw, vh, ch, ex, lh, and newer viewport variants) are calculated from something else: the parent font size, the root font size, the containing block, or the viewport. That difference decides how your layout behaves when users zoom, change their browser's default font size, or open the page on a phone.

Where the difference shows up

  • Accessibility: If a user raises their browser's base font size, rem-based text and spacing scale with it. A px-only layout often stays put, which is exactly the failure mode that makes text hard to read.
  • Component reuse: em compounds through nesting, so a button inside a smaller container shrinks its own padding and text. rem stays anchored to the root, which is why it is common for type scales and spacing systems.
  • Fluid layout: %, vw, and vh respond to the container or viewport. They are useful for full-bleed sections, but vw ignores scrollbars in some cases and vh can misbehave on mobile browsers with dynamic toolbars.
  • Fine detail: px remains predictable for hairline borders, shadows, and cases where you want an exact device-pixel result.

Quick comparison

Unit type Reference point Scales with user font size Typical use
Absolute (px, pt, cm, in) Fixed size No Borders, fine detail, print
Relative (rem, em, %) Root, parent, or container Yes, for font-based units Text, spacing, components
Viewport (vw, vh, vmin, vmax) Viewport dimensions Not directly Hero sections, fluid type
Character-based (ch, ex) Glyph or x-height Yes Measure, form field widths

A practical next step

Start with rem for font sizes and spacing, % or fr for layout widths, and px for borders and shadows. When you are unsure, test one specific case: set your browser's default font size to "Very Large" and reload. Anything that fails to grow is a candidate for a relative unit.

For a decision aid, the flowchart at What CSS length unit should you use? walks through unit choices interactively. If you want the underlying specifications, MDN Web Docs documents each unit's reference point and browser behavior.

How do CSS length units affect responsive design?

CSS length units determine how sizes scale when the viewport, font size, or user preferences change. That is what makes them central to responsive design: the unit you pick decides whether a value stays fixed or adapts.

The core split

  • Absolute units like px are fixed. They ignore the user's font-size settings and don't scale with the viewport. Useful for hairlines, borders, and anything that should stay crisp.
  • Font-relative units like em and rem scale with text. rem is tied to the root font size, so it respects a user's browser font-size preference. em compounds against the parent, which is powerful for component-level scaling but easy to misjudge.
  • Viewport-relative units like vw, vh, vmin, vmax scale with the browser window. They suit full-bleed sections and fluid type, but pure vw text can become unreadably small or absurdly large.
  • Percentage is relative to the parent's corresponding dimension, so its behavior depends heavily on context.

A practical scenario

You're building a card grid. Padding in rem keeps spacing consistent with the user's text size. A max-width in rem or ch keeps line lengths readable. A hero section's height in vh fills the screen, while clamp() mixing rem and vw gives headings that scale but stay within sane bounds.

The trade-off is always the same: fixed units give you predictable control, relative units give you adaptation. Most responsive layouts mix both.

Deciding quickly

Ask what the value should respond to. If it should follow the user's text settings, use rem. If it should follow the container or viewport, use % or viewport units. If it must never change, use px.

For a visual decision path, What CSS length unit should you use? offers a flowchart covering these choices.

What are common mistakes when using CSS length units?

The most common mistakes come from treating CSS length units as interchangeable when they answer different questions: how big is the text, how big is the viewport, or how big is the parent element. A unit that behaves well in one context often breaks in another.

Frequent pitfalls

  • Using px for everything. It is predictable, but it ignores user font-size preferences and does not scale with the rest of a fluid layout. Fine for borders and hairlines; weaker for body text and spacing that should adapt.
  • Mixing em carelessly. em is relative to the current element's font size, so nested elements compound. A 2em padding inside an element that already has a larger font can balloon unexpectedly. rem avoids this because it is always relative to the root.
  • Confusing % on different properties. A percentage width resolves against the containing block's width, but a percentage padding or margin also resolves against width — even for top and bottom. That surprises people who expect vertical percentages to use height.
  • Assuming viewport units are stable on mobile. vh can behave oddly when browser UI (address bars) shows or hides, and vw can trigger horizontal scrolling if a scrollbar is present. dvh, svh and lvh exist to address the dynamic viewport.
  • Ignoring line-height unitlessness. Setting line-height in px or em can break inheritance; a unitless number scales with each element's own font size and is usually the safer default.
  • Forgetting accessibility. Locking text in px can prevent users who increase their browser's default font size from seeing larger text.

A practical decision rule

If you want… Prefer Why
Text and spacing that respect user settings rem Root-relative, predictable, scales
Component-local scaling em Relative to the component's own font size
Fluid layout tied to the viewport %, vw, dvh Adapts to container or screen
Fixed, non-scaling details px Simple and stable for borders, hairlines

As a next step, try the same component twice — once with all px values, once with rem and % — and resize the browser text setting. The difference in readability and layout stability will show you where each unit belongs. For a visual decision aid, What CSS length unit should you use? walks through choosing a unit with a flowchart.

How do CSS length units impact accessibility?

CSS length units affect accessibility mainly through how they respond to user font-size settings, zoom, and viewport changes. Units tied to the user's font size (such as rem and em) preserve text scaling; fixed units (such as px) do not scale with browser font-size preferences, which can make text too small for readers who have increased their default size.

The practical distinctions:

  • rem scales with the root font size, so it respects browser and OS font-size settings. This is usually the safest choice for font sizes, spacing, and layout widths.
  • em scales relative to the parent element's font size. Useful for components that should scale as a block, but nesting can compound sizes unexpectedly.
  • px is absolute in CSS terms and ignores user font-size preferences. Fine for borders or hairlines, risky for body text.
  • Viewport units (vw, vh) respond to screen size, not user text preferences. Text sized only in vw can become unreadably small or large and may not respond to zoom consistently.
  • ch, ex relate to character or x-height metrics and can support readable line lengths, but they are less predictable across fonts.

For a concrete scenario: a reader with low vision sets their browser default font to 24px. A page using font-size: 1rem grows accordingly; a page using font-size: 16px stays fixed and may be difficult to read. The same principle applies to spacing and container widths—if everything is in px, the whole layout stays small even when the user asks for larger text.

A useful next step is to open the browser's font-size settings, set a larger default, and reload your page. If text and layout scale, your unit choices are supporting accessibility; if they stay fixed, audit where px is used for text and spacing. For a quick decision aid, the flowchart at What CSS length unit should you use? maps common CSS situations to suitable units.

Related questions

More questions →
When to Use px, em, rem, %, vw, or vh in CSS

Pick the unit that matches what the size should respond to: use px for fixed, non-scaling details; rem for most font sizes and spacing that should respect user settings; em for sizing that should scale with its own element's font; % for sizes relative to a parent; and vw/vh for sizes tied to the viewport. The rest of this explains the mechanism behind each and the cases where it backfires.

The core question: what should this size follow?

Every CSS length unit answers a different question about what it scales with. Before choosing, decide which of these you want:

  • Nothing — the size stays the same regardless of user settings or context → px
  • The user's root font size → rem
  • The current element's font size → em
  • The parent element's size → %
  • The browser viewport → vw / vh

The whatunit.com flowchart is built around exactly this decision: you follow branches based on whether you want fixed, scalable, or container-relative sizing, and it lands on a unit. It's an interactive diagram — you can click and drag to pan and use ctrl/cmd + mouse wheel to zoom.

px — fixed pixels

px is an absolute unit. It does not change when the user increases their browser's default font size, and it does not inherit from a parent.

Use it when:

  • You want a hairline border, a 1px divider, or a fixed shadow offset.
  • A size genuinely should not scale — for example, a decorative rule or a fixed icon dimension.

Avoid it when:

  • The value is text-related. A user who sets a larger default font size will not see your px text grow, which hurts accessibility.
  • You want consistent spacing that scales with typography.

rem — relative to the root font size

rem means "root em." It resolves against the font size of the root element (html), which by default is the user's browser font-size setting (commonly 16px, but the user can change it).

Use it when:

  • Setting font sizes — this respects the user's preference.
  • Setting spacing (margin, padding, gaps) that should scale with text.
  • You want a single knob (the root font size) to scale a whole layout.

Because every rem on the page points to the same root value, rem gives you predictable, globally consistent scaling. This is why it's the common default for typography and layout spacing.

em — relative to the current element's font size

em resolves against the font size of the element it's applied to (or the inherited font size for properties like font-size itself, where it compounds).

Use it when:

  • A component should scale as a unit with its own font size — for example, padding inside a button that should grow when the button's text grows.
  • You're building a self-contained component and want its internal proportions to hold.

The classic pitfall: em compounds. If you nest elements each with font-size: 1.2em, the sizes multiply down the tree, so a deeply nested element can end up much larger than intended. If you don't want that compounding, use rem instead.

% — relative to the parent

Percentages resolve against a property-specific reference, usually the parent element's corresponding dimension.

  • width: 50% → half the parent's width.
  • height: 50% → half the parent's height, but only if the parent has a defined height; otherwise it may collapse.
  • font-size: 120% → 120% of the inherited font size (similar compounding behavior to em).

Use it when:

  • You want fluid, container-relative sizing — a sidebar that's a fraction of its container, an image that fills its parent.
  • You're building responsive layouts where elements should track their container.

Watch out for the height case: percentage heights need a parent with a resolved height, or they won't behave as expected.

vw and vh — relative to the viewport

1vw is 1% of the viewport width; 1vh is 1% of the viewport height.

Use them when:

  • You want something to scale with the browser window — a full-screen hero section (height: 100vh), or fluid type that grows with the screen.
  • You want a layout dimension tied to the visible area rather than any parent.

Cautions:

  • 100vh on mobile can be taller than the visible area because of browser UI (address bars), so content may be cut off. Test on real devices.
  • Viewport units ignore the parent entirely, so they can break out of a constrained container in ways you didn't intend.

Quick comparison

Unit Scales with Best for Main pitfall
px Nothing Borders, fixed details, non-scaling elements Ignores user font-size settings
rem Root font size Font sizes, spacing, global scaling Depends on root value being sane
em Current element's font size Self-scaling components Compounds when nested
% Parent element Fluid, container-relative layout Height needs a defined parent height
vw / vh Viewport Full-screen sections, viewport-fluid sizing Mobile vh mismatch; ignores parents

A practical default

If you want one rule to start from: use rem for typography and spacing, px for borders and genuinely fixed details, % for container-relative layout, and reach for vw/vh only when the viewport itself is the right reference. Use em deliberately when you want a component to scale with its own text.

When two units seem to fit, ask which thing the size should follow — the user's settings, the parent, or the screen. That answer picks the unit. The whatunit.com flowchart is a useful cross-check when you're unsure; it walks the same fixed-vs-scalable-vs-container-relative decision and returns a single recommendation.

How to Use the whatunit.com Flowchart to Choose a CSS Length Unit

Open whatunit.com and start at the top question of the flowchart, then answer each branch based on your situation until you reach a suggested unit. The site is a decision aid, not a CSS specification: it helps you narrow choices like px, em, rem, %, vw, and vh, but you still confirm the final choice against your layout, accessibility needs, and browser support requirements.

What the site actually provides

whatunit.com presents a single interactive flowchart titled "What CSS length unit should you use?" Its purpose is to help you decide which unit fits a given case. The page describes two interaction controls:

  • Click and drag to move around the chart.
  • Ctrl/cmd + mouse wheel to zoom in and out.

The page also mentions a weekly newsletter signup for CSS tips. No pricing, account requirement, or login restriction is stated on the page, so treat access as unspecified rather than assuming it is free or gated.

Step-by-step: using the flowchart

  1. Open the page. Load whatunit.com in your browser. The flowchart is the main content.
  2. Find the starting question. Begin at the top node and read the first decision point.
  3. Answer honestly for your case. Each branch corresponds to a condition — for example, whether the size should scale with the user's font settings, the viewport, or the parent element.
  4. Follow the branch to the next node. Repeat until you reach a leaf node recommending a unit.
  5. Navigate the chart as needed. Drag to pan if part of the chart is off-screen. Use ctrl/cmd + mouse wheel to zoom in when labels are small or zoom out to see the whole path.
  6. Apply the result to your CSS. Take the recommended unit and write your declaration, then verify in the browser.

Expected result: you end at a specific unit recommendation with the reasoning path visible, so you can see why that unit was suggested rather than just what it is.

Reading the outcome

The flowchart narrows to units such as px, em, rem, %, vw, or vh. Use the path you followed as the justification:

If your condition is about… The chart tends to point toward…
Fixed, non-scaling sizes px
Sizing relative to the parent element's font size em
Sizing relative to the root font size rem
Sizing relative to a containing block %
Sizing relative to viewport width or height vw / vh

Treat this table as a summary of the kind of decision the chart encodes, not a replacement for following the actual branches — the chart's value is in the ordered questions, which capture nuance a table flattens.

Common sticking points

  • Zoom feels stuck. The page specifies ctrl/cmd + mouse wheel, not pinch or plain scroll. Use the modifier key.
  • You lose your place after panning. Zoom out first to reorient, then zoom back in on the branch you were following.
  • The recommendation conflicts with your design system. The flowchart answers "what unit fits this condition," not "what does your team's convention require." Follow your project's rules when they exist.
  • You need edge cases. A flowchart cannot cover every cascade, container query, or clamp() scenario. Use it as a quick reference and confirm details against the CSS specification when precision matters.

When this approach fits

Use the whatunit.com flowchart when you want a fast, visual way to reason about a single sizing decision and you already understand basic CSS units. Skip it when you need authoritative syntax, browser-compatibility data, or guidance on modern features like container query units — for those, go to the specification or MDN.

What is whatunit.com?

whatunit.com is a single-purpose decision aid for choosing CSS length units. Its page asks "What CSS length unit should you use?" and answers with an interactive flowchart: you click and drag to move around the chart and use ctrl/cmd + mouse wheel to zoom in and out. It is useful when you are writing CSS and are unsure whether a given length should be expressed in px, em, rem, %, vw, vh, or another unit, and you want a quick, visual way to reason through the choice instead of guessing. The site also invites visitors to sign up for a weekly CSS newsletter.

What the site actually provides

Based on the page content, the offering is narrow and concrete:

  • A decision flowchart for CSS length units. The chart is the core tool, framed as the answer to the question in the page heading.
  • Interactive navigation. Click and drag to pan across the flowchart; ctrl/cmd + mouse wheel to zoom in and out.
  • A newsletter signup. The page notes that if you find the tool useful, you can consider signing up for a weekly newsletter to "keep on top of your CSS game."

Nothing on the page indicates pricing, accounts, or login requirements, so treat access details as unstated rather than assuming the tool is free or gated.

When this site is the right stop

Reach for whatunit.com when the question is which unit, not how a unit works. Typical moments:

  • You are choosing between a fixed and a relative unit for a spacing, font-size, or layout value and want a structured prompt for the trade-offs.
  • You are reviewing someone else's CSS and want a second opinion on whether a unit choice is defensible.
  • You are teaching or explaining CSS units and want a visual aid to walk through the decision.

It is less suited to looking up syntax, browser support, or the precise computed behavior of a unit — the page presents a flowchart, not reference documentation.

How to use the flowchart

  1. Open whatunit.com.
  2. Read the starting question in the heading and locate the first decision node in the chart.
  3. Pan by clicking and dragging so you can follow the branch that matches your situation.
  4. Zoom with ctrl/cmd + mouse wheel when labels or branches are too small or too spread out to read.
  5. Follow the branches until you reach a recommended unit, then apply it to the CSS value you are writing.

Expected result: you end at a specific unit recommendation tied to the conditions you followed, rather than a general list of every unit.

Common sticking points

  • Losing your place while panning. Because the chart is navigated by dragging, it is easy to drift away from the branch you were reading. Zoom out slightly to reorient before continuing.
  • Zoom not responding. The page specifies ctrl/cmd + mouse wheel, not pinch or a plain scroll, so use the modifier key.
  • Expecting a searchable reference. The tool is a flowchart; if you need definitions or compatibility tables, you will need another source alongside it.

Related option

If you want ongoing CSS guidance rather than a one-off unit decision, the site's weekly newsletter signup is the adjacent offering mentioned on the page. Use the flowchart for the immediate choice and the newsletter if you want recurring material.

Where to Find the CSS Length Unit Flowchart and Newsletter on whatunit.com

The CSS length unit flowchart is the primary content on the whatunit.com homepage. Open the site and you land directly on the tool — there is no separate page or download required. The page also mentions a weekly newsletter signup for keeping up with CSS, and encourages sharing the tool if you find it useful.

What the homepage contains

The site is built around a single interactive decision aid titled "What CSS length unit should you use?" Its stated purpose is to help you decide which unit to use, and it presents that guidance as a flowchart rather than as prose.

Two elements sit alongside the flowchart:

  • A weekly newsletter signup — described as a way to "keep on top of your CSS game."
  • A share prompt — the page says that if you find the tool useful, sharing it would be appreciated.

How to operate the flowchart

The page gives three interaction instructions directly:

Action How to do it
Move around the diagram Click and drag
Zoom in Ctrl (Windows/Linux) or Cmd (Mac) + mouse wheel
Zoom out Ctrl (Windows/Linux) or Cmd (Mac) + mouse wheel

So the flowchart is pannable and zoomable rather than a fixed image. If the diagram initially appears larger or smaller than your viewport, that is expected — use the modifier key plus wheel to set a comfortable zoom level, then drag to reach the branch you need.

Getting the newsletter

The newsletter signup is referenced on the same page as the flowchart. The page evidence does not describe the signup form fields, confirmation flow, or what a subscription includes beyond the general framing of staying current with CSS. If you want it, look for the signup link or form on the homepage itself rather than a dedicated /newsletter route, since none is documented.

Practical notes

  • The tool is a decision aid, not a reference table — you answer the flowchart's questions in sequence to arrive at a unit recommendation.
  • Because the content is interactive, it works best on a device with a mouse or trackpad where the ctrl/cmd + wheel gesture is available.
  • Nothing on the page indicates pricing, an account requirement, or a login gate for the flowchart itself.

Website Overview

Several search or sharing settings need attention. Together they may make snippets, preview images or preferred URLs less consistent across platforms.

Domain and Registration

Transfer-protection status is present, helping reduce the risk of unauthorized domain transfers. The domain has about 2 years of registration history; its current configuration provides more context than age alone. The registrar is NameCheap, Inc., a widely used domain service provider. The domain uses the common .com extension, which is not an independent safety signal.

DNS and Email

Nameservers are provided by NS1, indicating managed DNS hosting. No CNAME was found; the observed records resolve directly to addresses. No MX record was found. A conventional explicit inbound-mail route is not configured. DNSSEC signatures were not detected, so this additional DNS authenticity protection is not confirmed. The lowest observed DNS TTL is 120 seconds.

TLS and Certificates

The public key uses EC with 256 bits. The server supplied a complete certificate chain. No organization name is present in the certificate; the available fields are consistent with domain validation. The certificate was issued by Let's Encrypt, commonly associated with automated certificate services. The certificate's total validity is about 89 days, consistent with a short renewal cycle.

HTTP and Browser Security

The response lacks these common security headers: CSP, X-Content-Type-Options, Referrer-Policy, Permissions-Policy, clickjacking protection. No X-Powered-By header was found, reducing one common source of backend fingerprinting information. No obvious internal addresses or debug information were found in the headers. The Server header contains the custom value Netlify. No explicit CDN or WAF marker was found in the response headers.

Technology Stack Analysis

The public page identifies Netlify without precise versions, leaving fewer clues for version-specific scanning.

Search and Social Sharing

No homepage meta description was detected, leaving snippet selection more dependent on page text. No homepage canonical URL was detected. If duplicate URLs exist, consolidation may be less explicit. No Open Graph metadata was detected, so social previews may depend on platform inference. The title has 36 characters, within a common display range. The observed directives allow indexing and link following.

Hosting and Email

DNSNS1
HostingNetlify
EmailUnknown
Approximate IP geolocation (inferred; a CDN or proxy may differ from the origin server) United States flagAshburn, Virginia, United States Inferred 18.208.88.157

Registration details

RDAP / WHOIS

RegistrarNameCheap, Inc.
Registered2023-11-03
Expires2027-11-03
Domain statusclient transfer prohibited
Nameserversdns1.p03.nsone.net、dns2.p03.nsone.net、dns3.p03.nsone.net、dns4.p03.nsone.net
DNSSECunsigned

DNS records

DNS

TypeNameValueTTLPriority
Awhatunit.com18.208.88.157120—
Awhatunit.com98.84.224.111120—
NSwhatunit.comdns1.p03.nsone.net3600—
NSwhatunit.comdns2.p03.nsone.net3600—
NSwhatunit.comdns3.p03.nsone.net3600—
NSwhatunit.comdns4.p03.nsone.net3600—

TLS and certificates

TLS / SSL

AssessmentNormal configuration
Supported protocolsTLSv1.2、TLSv1.3
Negotiated protocolTLSv1.3
Certificate subjectwhatunit.com
IssuerLet's Encrypt
Valid until2026-12-02T03:50 · Remaining when checked: 57 days
Verification detailsCertificate trust: Passed · Hostname match: Passed

HTTP response headers

HTTP

HeaderValue
content-typetext/html; charset=UTF-8
cache-controlpublic,max-age=0,must-revalidate
serverNetlify
strict-transport-securitymax-age=31536000

Identified technologies

Netlify

Pages, Search and Sharing

Meta descriptionNot detected
Canonical URLNot detected
LanguageEnglish (default)
Twitter CardNot detected

Unknown

No robots.txt found

No sitemaps found

User reviews (0)

  • No reviews yet.