Mastering CSS
上QQ阅读APP看书,第一时间看更新

Loading Eric Meyer's CSS reset

There are a few different resets to choose from, but I've been hooked to the CSS guru Eric Meyer's reset. Let's go grab it from meyerweb.com/eric/tools/css/reset/:

So, scroll down a little bit to find the top of the reset, then just highlight all of the code until you get to the closing curly brace:

Switch over to Sublime, open your style sheet, and paste it in there:

Before we save this, let's open the index.html file for our site. One of the things you can do with Sublime is this: if you right-click on your HTML file, you can select Open in Browser and it will open your default browser:

In my case, it's Chrome. So this is what the site will look like without the reset:

As you can see in the next screenshot, all of the CSS we added actually removed the little bit of styling we had. This is why we call it a reset. All text looks the same—no margin, no padding, no nothing.