XHTML, CSS, PHP, Javascript, AJAX
Wordpress, Expression Engine, JQuery

eric janofski  |  906.399.2920  |  eric@ericjanofski.com

Design / Development Blog View All In This Category

CSS Reset, A Simple Approach

Posted: 07/31/2009.
 

When I began designing websites, all of the styles were inline with the HTML. Needless to say, creating large sites was a desperate pain in the bottom. Eventually I learned how to create external sheets with CSS and Web design for the first time became a pleasure. I’ve picked up a few tricks along the way and would like to share one of the simplest, but handiest line of css code that I know.

The Asterisk!

* {
padding:0;
margin:0;
}

This asterisk simply refers to all tags. It sets all defaults to have no padding or margins. This may be a pain at first because elements such as p tags will lose their spacing, but you can simply define what you want the padding and spacing to be. This takes some of the browser variation out of the equation and simplifies the task of getting your designs to look exact in every browser.

Another addition to my simple CSS Reset Stylesheets is to set the border to none where images are inside “a” tags. Otherwise you may get a blue line around thumbnail links… Yuck!

a img {
border:none;
}

Simple, right?

Some designers use heavy CSS Reset stylesheets. Eric Meyer for instance uses a strongly developed CSS Stylesheet that resets many of the default browser styles to a stripped down starting point. The method I use is far more simple, not better in all cases, just simpler to start with. I hope this helps.

Tags: ,

One Response to “CSS Reset, A Simple Approach”

  1. Eric says:

    Something to consider: Using the Asterisk method is processor intensive and for that reason, I am going to shift to a similar approach to Eric Meyer. The asterisk is a simple fix, but perhaps I’ve been lazy in using this method.

Leave a Reply

Recent Posts

The band Stinger has transformed itself from a powerhouse Metal Pantheon to a collaborative team of designers and developers. I am extremely excited to begin working with my dear friends and creative partners Jon Damaschke and Thon Lorenz. more…

When I began designing websites, all of the styles were inline with the HTML. Needless to say, creating large sites was a desperate pain in the bottom. Eventually I learned how to create external sheets with CSS and Webdesign for the first time became a pleasure. more…

Welcome to my redesigned portfolio website. This site is powered by Wordpress and was developed from scratch. Yes, I could have used the Default template, but that would have been too easy. more…