386 henriko.se Lör 28 Jan


My "CSS reset" as of January 2023.


The purpose of a "CSS reset" is to override browser defaults, to other more preferable defaults.

In the early days of the web, each web browser had a lot more of its own personality, which made it hard to get pages to look the same on every browser, without first overriding their unique defaults. There are still some differences, but in general this is not such a big deal any more.

Even if different browsers have come to be more similar over time in this regard, depending on what you want to achieve and how you want to work, it can still save you a lot of coding in the long run, by overriding a lot of the browsers defaults early on.

There is a lot of different opinions and strategies regarding "CSS resets", or "CSS normalize" as some prefer to call it. Some resets attempts to deliver one basic and usable style, to build on top of. Some other resets will kind of nuke everything, so everything has to be built up again from scratch.

My CSS reset, henrik0 will leave some things more usable then they are in the browsers defaults, like a table, which will look like a table. But mostly it will make things look worse, so I guess my reset mostly belong to the category of resets that nuke everything.

It will even fight the uniqueness of form input elements, which by default usually are styled as the corresponding user inputs in the operating system.

Actually, what this reset will leave you with is terrible and completely unusable as is. In order to use my reset, you have to have the intent to add your own style to everything. And if using forms, you even have to provide you own style to form elements as well, making sure things like hover and focus is taken care of.

If you will not use my reset as a whole, feel free to pick any pieces from it, which you think might be useful.