designwithfocus

CSS

How to Add Normalize CSS to a Page or a Build Step

By Design With Focus Team 6 min read
A stylesheet link in the head sitting above a shorter custom CSS file

Short answer

Add normalize.css 8.0.1 before your own stylesheet, either with a link to the project file or with npm install --save normalize.css. The readme calls it a modern alternative to CSS resets that preserves useful defaults. The npm registry lists 8.0.1 under the MIT license. Your rules must come later in the author origin so equal specificity lets your declarations win.

Last verified against the sources listed below.

Key takeaways

  • The normalize.css readme says it preserves useful defaults, unlike many CSS resets.
  • The npm registry lists version 8.0.1, MIT licensed, published on 9 November 2018.
  • Load the file before your stylesheet. Later author rules win ties on specificity.
  • The readme says Firefox ignores box-sizing, padding, and width on checkboxes and radios.
  • Browser support on the readme includes Chrome, Edge, Firefox ESR+, IE 10+, Safari 8+, and Opera.

How to add normalize CSS is a one-file step: load Nicolas Gallagher’s normalize.css before the rules you write. The project readme calls the file a modern alternative to CSS resets. It preserves useful defaults, normalizes a wide range of elements, corrects bugs and common browser inconsistencies, and explains itself with comments.

The npm registry lists the latest version as 8.0.1, published on 9 November 2018, with an MIT license. The registry’s update stamp on that record is 6 May 2024. As of December 2026, that is the version the latest tag refers to. There is no newer version in the registry history.

Browsers already style a page before your file arrives. MDN calls those rules user-agent stylesheets. Normalize does not delete that origin. It is an author stylesheet that makes the defaults agree across the browsers the readme names.

What you need

You need one of two delivery paths from the project, plus a stylesheet of your own that will load after it.

  • The readme’s download URL is https://necolas.github.io/normalize.css/latest/normalize.css.
  • The readme’s install command is npm install --save normalize.css.
  • A page or a bundler that can emit CSS in an order you control.
  • The box model in mind, because the readme calls out controls that ignore parts of it.

The readme’s browser list is Chrome, Edge, Firefox ESR+, Internet Explorer 10+, Safari 8+, and Opera. That list is the project’s claim. It is not a grid of pass or fail results.

Add the file to a single page

Do these in order. Each step is one action.

  1. Copy the official latest URL from the readme, or save that file next to your page.
  2. Put a link element in the document head with rel="stylesheet" and that href.
  3. Put your own stylesheet link after the normalize link.
  4. Reload the page and confirm the network panel requests normalize before your file.
  5. Leave the file’s comments in place if you copied it, so the next edit can see why a rule exists.

The head order is the product. CSS Cascading and Inheritance Level 5 says linked stylesheets are concatenated in linking order. If two author declarations tie on the earlier cascade steps, the later one wins.

<link rel="stylesheet" href="https://necolas.github.io/normalize.css/latest/normalize.css" />
<link rel="stylesheet" href="site.css" />

What CSS is for is the author origin those two files share. Normalize is not a special layer unless you wrap it in @layer yourself. The readme does not tell you to do that.

Add the file in a build step

Use the package when the site already has a bundler.

  1. Run npm install --save normalize.css from the project the readme shows.
  2. Import or copy normalize.css from that package at the start of your CSS entry.
  3. Keep every rule you write after that import in the emitted file.
  4. Build once and open the output to see the normalize block above your selectors.
  5. Commit the lockfile change so the install stays on 8.0.1 until you choose a newer release.

The readme points CDN users at the Yarn package page instead of embedding a host name and a version path. If a tutorial offers a different host, check it against the registry version before you trust the bytes.

A button you design after this step can start from a CSS button generator. The generator output belongs in your stylesheet, not inside the normalize file. Editing the third-party file makes the next upgrade a merge.

What the file is allowed to change

The readme lists five jobs: preserve useful defaults, normalize elements, correct bugs, improve usability with small changes, and document the code. It does not say it removes every margin.

A few notes in the readme are the ones that surprise people later:

  • pre, code, kbd, and samp set font-family to monospace, monospace on purpose, to fix inheritance and font-size scaling.
  • sub and sup are adjusted because they otherwise change the line-box height in all browsers.
  • Chrome and Safari on macOS barely style a select until a border is set, and the default optgroup font weight is not safe to change there.
  • Do not expect box-sizing, padding, or width to apply to checkboxes and radios in Firefox.
  • Some number-input font sizes change the decrement button’s cursor from default to text.
  • Search inputs stay partly native. The readme says -webkit-appearance: textfield addresses the styling limits without dropping the search field’s extras.

Those are the project’s words. If a control still looks native, read that note before you add another reset.

Troubleshooting

What you see Likely cause What to change
Your type rules never show Your file is linked before normalize Move your link or import later
Headings still differ by browser The latest file did not load Open the official URL and confirm 8.0.1 is current on npm
A checkbox ignores width Firefox, per the readme Stop sizing those inputs with the box model
A search box ignores padding Chrome or Safari limits in the readme Read the search-input note before adding rules
Two resets fight A second reset also loads Keep one consistency file
Upgrade looks empty Registry latest is still 8.0.1 Do not wait for a 9.0 that the registry does not list

MDN’s cascade steps explain the first row. Origin and importance come before specificity, and inside normal author styles the next steps are specificity, scoping proximity, then order of appearance.

Normalize and your file are both normal author CSS. Matching specificity means the later rule wins. A more specific selector in your file still beats a normalize rule for that property, which is what you want when you style one component.

Do not mark the whole normalize file !important. Cascade Level 5 puts important author declarations above normal author declarations. That would make the consistency file harder to override than the readme’s design, which is a set of ordinary rules you are expected to follow with your own.

Frequently asked questions

Which version should the link or the install use?

The npm registry page for the package named normalize.css lists 8.0.1 as latest. That version was published on 9 November 2018, and the registry record shows an update on 6 May 2024. The license field is MIT. The readme's download link points at necolas.github.io/normalize.css/latest/normalize.css, which tracks that latest file. Do not invent a 9.x release. Nothing on the registry history after 8.0.1 is a newer version.

Does normalize.css zero margin and padding on every element?

The readme does not describe a universal margin reset. It says the file preserves useful defaults, unlike many CSS resets, and that it normalizes styles, corrects bugs, and makes small usability changes. Treat it as a consistency layer on top of the browser's user-agent stylesheet, which MDN describes as the browser's own basic styles. If you also load a reset that sets margin to zero, you are no longer using only the project file.

Where does the file sit relative to my CSS?

Put the normalize link or import first, then your stylesheet. MDN's cascade order says that when origin, importance, layers, and specificity tie, the last declaration in document order wins. Two author rules with the same specificity therefore follow source order. Linking your file first lets the normalize rule come later and replace yours. The HTML spec treats linked stylesheets as concatenated in linking order.

Why do checkbox styles seem to be ignored?

The project readme says not to style checkbox and radio inputs as if box model properties will apply. Firefox's implementation does not respect box-sizing, padding, or width on those controls. The same notes say a search input is not fully stylable in Chrome and Safari, and that setting a border is what lets Chrome and Safari on macOS style a select more freely. Those limits are in the file's comments, not bugs in your build.

Can I add it in a bundler without a link tag?

Yes. The readme's install line is npm install --save normalize.css. After that, the package is the dependency your bundler can load. The readme does not print an import statement. Point the bundler at the package, and emit that CSS before the CSS you write. The CDN note on the readme sends you to the Yarn package page rather than printing a third-party stylesheet URL, so prefer the install or the official latest file.

Sources