Normalize vs Reset CSS
Each browser provides a set of default styles which are applied for every web pages it renders. The default style sheet is also known as the user-agent style sheet.
You can take a look at the default styles provided by:
Since the default styles are not the same, causing a web page will have different look and feel on each browser. Both normalizing and resetting CSS aim to fix that problem.
Resetting CSS, as the name suggests, will reset all the built-in styles.
The most popular CSS reset library is Meyer's reset.css which you can see the complete code here. For example, it resets the
If you use the Developer Tool of Chrome browser, and inspect the body element of any web page, you will see that it has the margin of 8px by default which we often don't want to have at all:
Normalizing CSS is another alternative to resetting CSS.
The most popular library in this area is normalize.css. It tries to make built-in browser styling consistent across browsers.
More than that, the library also:
- Makes some elements look like what we expect.
For example, the Chrome, Firefox and Safari browsers use the following styles for the
It's not easy for us to distinguish these tags with normal one visually. normalize.css improves by declaring the position for these tags:
- Fix display bugs across browsers.
You can look at its source code to see there are lot of bug fixes for different browsers such as Internet Explorer, Edge, Firefox, etc.
You don't need to include normalize.css if you use popular CSS libraries. It's already included in: