The Modern CSS Reset
A minimal, sensible CSS reset for 2026
The Modern CSS Reset
Browsers have default styles that get in the way. Here's a minimal reset that makes sense.
The Full Reset
/* Box sizing */*, *::before, *::after { box-sizing: border-box;}
/* Remove default margin */* { margin: 0;}
/* Body defaults */body { line-height: 1.5; -webkit-font-smoothing: antialiased;}
/* Improve media defaults */img, picture, video, canvas, svg { display: block; max-width: 100%;}
/* Inherit fonts for form elements */input, button, textarea, select { font: inherit;}
/* Avoid text overflows */p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word;}
/* Root stacking context */#root, #__next { isolation: isolate;}Why Each Rule
Box Sizing
*, *::before, *::after { box-sizing: border-box;}Makes width/height include padding and border. Essential for predictable layouts.
Remove Margins
* { margin: 0;}Browsers add margins to headings, paragraphs, lists. Remove them and add your own intentionally.
Line Height
body { line-height: 1.5;}Default is too tight. 1.5 is readable for body text.
Font Smoothing
body { -webkit-font-smoothing: antialiased;}Looks better on Mac. Lighter, more consistent.
Media Elements
img, picture, video, canvas, svg { display: block; max-width: 100%;}blockremoves the annoying space below imagesmax-width: 100%prevents overflow
Form Elements
input, button, textarea, select { font: inherit;}Form elements don't inherit font by default. This fixes it.
Text Overflow
p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word;}Prevents long words from overflowing containers.
Isolation
#root, #__next { isolation: isolate;}Creates a new stacking context. Prevents z-index conflicts with portals/modals.
Optional Additions
/* Smooth scrolling */html { scroll-behavior: smooth;}
/* Reduced motion */@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }}
/* Remove list styles */ul[role="list"], ol[role="list"] { list-style: none; padding: 0;}The Point
A good reset is small and intentional. It removes browser quirks without overriding everything. Add styles you need, not styles you'll fight against.
Stay Updated 📬
Get the latest tips and tutorials delivered to your inbox. No spam, unsubscribe anytime.