← Back toCross Browser

Normalize CSS

Written byPhuoc Nguyen
07 Sep, 2022
Each browser provides a set of default styles which are applied for every web page it renders. The default style sheet is also known as the user-agent style sheet. For example, here is the default styles provided by popular browsers:
Since they aren't the same as each other, a web page looks differently on each browser. Normalizing CSS is a technique to fix the issue. It tries to make the default styles of native elements consistently cross browsers.
For example, we can use the HTML 5 `hidden` attribute to hide an element completely:
<input type="text" hidden />
However, the attribute isn't supported on IE 10. So we should include the following declaration:
[hidden] {
display: none;
normalize.css is a popular library providing these kinds of fixes. If you take a look at its source code, you'll realize that there are lot of bug fixes for different browsers such as IE, Chrome, Firefox, Safari there.
Popular CSS libraries include or build their normalized CSS on top of `normalize.css`, for example:

Questions? 🙋

Do you have any questions? Not just about this specific post, but about any topic in front-end development that you'd like to learn more about? If so, feel free to send me a message on Twitter or send me an email. You can find them at the bottom of this page.
I have a long list of upcoming posts, but your questions or ideas for the next one will be my top priority. Let's learn together! Sharing knowledge is the best way to grow 🥷.

Recent posts ⚡

Newsletter 🔔

If you're into front-end technologies and you want to see more of the content I'm creating, then you might want to consider subscribing to my newsletter.
By subscribing, you'll be the first to know about new articles, products, and exclusive promotions.
Don't worry, I won't spam you. And if you ever change your mind, you can unsubscribe at any time.
Phước Nguyễn