The Modern CSS Reset — What to Include and Why

  • Home
  • CSS
  • The Modern CSS Reset — What to Include and Why
Front
Back
Right
Left
Top
Bottom
STILL IN 2027

Do You Still Need a CSS Reset in 2027?

Every senior frontend engineer I know has a slightly different answer to this. Here’s mine after shipping production UIs for 7+ years: yes — but far less than you think.

The browser landscape has genuinely improved. Since 2022, the Interop initiative brought Apple, Google, Mozilla, and Microsoft into unprecedented alignment — Interop 2022, 2023, and 2024 tackled sticky positioning, subgrid, `:has()`, `color-mix()`, and dozens of other once-inconsistent features — CSSPortal, 2026. The practical result: the number of genuine browser inconsistencies you need a reset to fix has dropped dramatically.

But “fewer” isn’t “zero.” A lean, intentional reset is still the right foundation for every project.

MODERN RESET
2027 Edition

The Full Modern Reset

"Every CSS reset earns its place by correcting genuine papercuts — not fighting the browser."
Here’s the complete reset I use. Every single line is intentional:
🎨
/* Modern CSS Reset — 2027 Edition */
/* Inspired by Josh W. Comeau (joshwcomeau.com) and community consensus */

/* 1. Use a more-intuitive box model */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* 2. Remove default margins */
* {
  margin: 0;
}

/* 3. Improve text rendering */
body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* 4. Improve media defaults */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* 5. Inherit fonts for form elements */
input,
button,
textarea,
select {
  font: inherit;
}

/* 6. Avoid text overflows */
p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

/* 7. Improve line-wrapping (progressive enhancement) */
p {
  text-wrap: pretty;
}
h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

/* 8. Enable smooth height animations (in reduced-motion-safe context) */
@media (prefers-reduced-motion: no-preference) {
  :root {
    interpolate-size: allow-keywords;
  }
}

That’s it. Under 35 lines. Let me walk you through why each rule is there.
RULE-by-RULE

Rule-by-Rule Breakdown

Rule 1 — `box-sizing: border-box`

The default CSS box model is `content-box`, meaning that `padding` and `border` add to an element’s declared width. So a `width: 200px` button with `padding: 10px` is actually 220px wide. Every layout I’ve ever inherited had bugs from this.

`border-box` changes this so declared width *includes* padding and border — which is almost always what designers intend.

On a dashboard rebuilt in 2027 with strict `border-box` reset, cross-browser layout variance dropped from ~7% to ~1% — TheLinuxCode, 2026

Rule 2 — `margin: 0`

Browsers apply opinionated default margins to headings, paragraphs, lists, body. These vary subtly between browsers and bite you in unexpected places. Zeroing them out means you’re always working from an intentional baseline.

Rule 3 — `line-height: 1.5` + `antialiased`

`1.5` is the WCAG recommended minimum for body text readability. `-webkit-font-smoothing: antialiased` fixes the default Mac/Chrome font rendering that often looks heavy.

Rule 4 — Block-level media

By default, `<img>` is `inline`, which creates a mysterious gap below images (it leaves room for descenders like `g`, `y`, `p`). Setting `display: block` kills this. `max-width: 100%` prevents images from ever overflowing their containers.

Rule 5 — `font: inherit` on form elements

This is the most surprising to new developers. Browsers ignore your `font-family` on `<input>`, `<button>`, `<select>`, and `<textarea>` by default. This single rule ensures your typography system actually applies everywhere — CSSPortal, 2026.

Rule 6 — `overflow-wrap: break-word`

Without this, long URLs or unbreakable strings (common in user-generated content) overflow their containers and break layouts. This is the invisible text-wrapping bug you’ve seen in production and wondered how it happened.

Rule 7 — `text-wrap: pretty / balance`

`text-wrap: balance` prevents awkward single-word orphans on heading last lines. `text-wrap: pretty` improves paragraph wrapping for readability.

 

Browser support for `text-wrap` varies — `pretty` is at 72% support, `balance` at 87% as of late 2024. These don't need fallbacks because they're pure progressive enhancements. — Josh W. Comeau

Rule 8 — `interpolate-size: allow-keywords`

Added in early 2027 by Josh W. Comeau’s reset, this property enables CSS animations to/from `auto`, `fit-content`, and similar keywords — unlocking smooth height transitions that previously required JavaScript — joshwcomeau.com
MORMALIZE

What About Normalize.css?

Normalize.css still sees millions of weekly downloads. It’s not wrong — but it hasn’t had a major release since 2018 — CSSPortal, 2026. The browser interop improvements of 2022–2024 mean many of the inconsistencies it patches no longer exist.
My recommendation
Use the lean custom reset above instead of Normalize.css for new projects. If you’re inheriting a legacy project that uses Normalize, that’s fine — don’t swap it mid-project without thorough testing.
CASCADE

Organising Your Reset With Cascade Layers

Modern CSS Cascade Layers (`@layer`) let you load your reset at the lowest priority, ensuring component styles always win:
🎨
/* At the top of your main CSS file */
@layer base, components, utilities;

@import "reset.css" layer(base);
@import "components.css" layer(components);
@import "utilities.css" layer(utilities);
This pattern — popularized by CSS engineers like Paul Allen — ensures the reset never fights your component styles for specificity.
WHY
Why This Matters

For Business Leaders

Every cross-browser visual bug that reaches production carries a cost — developer debugging time, user frustration, support tickets, and brand credibility. A well-crafted CSS reset that takes 30 minutes to set up correctly on day one can prevent dozens of layout bugs over the life of a product. It’s the cheapest architectural investment in frontend development.

The modern CSS reset isn’t a copy-paste of Eric Meyer’s 2008 reset or a bloated normalize.css. It’s a curated list of ~30 lines that correct real papercuts: the box model, fonts on form elements, media gaps, and text overflow.

Set it up properly on day one, commit it to your design system, and never think about browser baseline inconsistencies again.

Good CSS resets work the same way — as few rules as possible, every one earning its place.

Explore project snapshots or discuss custom web solutions.

Good design is as little design as possible.

Dieter Rams, Industrial Designer

Thank You for Spending Your Valuable Time

I truly appreciate you taking the time to read blog. Your valuable time means a lot to me, and I hope you found the content insightful and engaging!
Front
Back
Right
Left
Top
Bottom
FAQ's

Frequently Asked Questions

Tailwind ships with Preflight — its own CSS reset based on modern.css/normalize principles. If you're using Tailwind, you don't need a separate reset. If you're not, you do.

Negligibly. Modern browsers are highly optimized for universal selector matching. The performance concern with `*` is a myth in 2027 contexts

Carefully. A reset on an existing project can shift layouts that rely on browser defaults. Introduce it page-by-page or component-by-component with visual regression testing.

A reset zeros out browser defaults aggressively. Normalize preserves useful defaults and only corrects genuine inconsistencies. Modern resets (like the one above) are actually closer to normalize — targeted corrections, not a full wipe.

Load it first — before any component styles. In Vite/Webpack projects, import it at the top of your main entry CSS. With Cascade Layers, put it in `layer(base)`.

Comments are closed