4.9 CSS Reset

Removing default browser styling

There is no such thing as an unstyled HTML element. Every webpage uses at least one CSS: the User agent Stylesheet.

The user agent stylesheet

This CSS file is included in the browser and is called:

  • every time a webpage is rendered
  • before any of our CSS is applied

Although each browser has its own User agent CSS, they are all fairly similar.

Applying a CSS reset

A browser’s default styles can interfere with the styles we actually want to apply. That’s why a CSS reset has been devised to provide a consistent base across all browsers.

It’s particularly useful for normalizing the text size and removing all margins.

You can find (and download) the HTML 5 reset.css of this website. Just include it in your <head> before your own stylesheet.

<head>
  <link rel="stylesheet" type="text/css" href="reset.css">
  <link rel="stylesheet" type="text/css" href="styles.css">
</head>
Back to top

Learn CSS with my ebook

This ebook is a step by step guide in which I teach you how to build your own personal webpage from scratch, line by line, with HTML5, CSS3, and even JS.

CSS in 44 minutes book cover
Get it now
Close