Before starting to build a website there is a fair amount of groundwork I usually do that will make my life easier down the road. For example, setting margin and padding to 0 on all elements, turning off borders on images and tables, left aligning all text, etc…This is standard procedure in my workflow and often I find myself adjusting this as I move forward. Recently I found a little gem, part of the YUI CSS framework that does all this for me in one swoop. The YUI CSS framework is great, but it has a bunch of stuff I don’t normally use, nor want to have my users download. Fortunately the developers at Yahoo! were smart enough to give this little piece of CSS enough importance to separate it into it’s own file. YUI Reset CSS “…removes and neutralizes the inconsistent default styling of HTML elements, creating a level playing field across A-grade browsers and providing a sound foundation upon which you can explicitly declare your intentions.” Which is exactly what I want to do before starting any project: level the browser playing field.

To include the CSS is fairly simple:

<!-- Source File --> 
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.7.0/build/reset/reset-min.css"> 

Now lets take a look at the contents of the css file:


/*
Copyright (c) 2006, Yahoo! Inc. All rights reserved.
Code licensed under the BSD License:

http://developer.yahoo.net/yui/license.txt

version: 0.11.3
*/

body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,
form,fieldset,input,p,blockquote,th,td {
          margin:0;
          padding:0;
         }
table {
          border-collapse:collapse;
          border-spacing:0;
          }
fieldset,img {
          border:0;
          }
address,caption,cite,code,dfn,em,strong,th,var{
          font-style:normal;
          font-weight:normal;
          }
ol,ul {
          list-style:none;
         }
caption,th {
          text-align:left;
          }
h1,h2,h3,h4,h5,h6{
          font-size:100%;
           }
q:before,q:after{
          content:'';
          }


While it’s not sexy nor earth shattering, it is unarguably practical.