What is a CSS Reset?

The goal of a CSS reset is to reduce inconsistencies with things like line height, font sizes, and margins.  Every browser defaults to different sizes and spacing and if you set a common baseline, you end up with a better end-product.

A basic example would look like:

body, div, h1,h2, h3, h4, h5, h6, p,ul {
margin: 0;
padding: 0;
}

Andy Bell and Josh W. Comeau have pretty good, pre-packaged CSS resets but the OG might be the one by Eric A. Meyer.

There is an argument that a CSS reset violates DRY (Don’t Repeat Yourself) but a good CSS reset is minified, blindly pasted in, and is common to all of your projects.  You might be setting things only set them again later but it will save you time and pain for a minimal cost.

 

[ Cover photo by Tom Grünbauer on Unsplash ]

Leave a Reply

Your email address will not be published. Required fields are marked *