*Overview:*
All browsers have minor differences in padding and margins applied to elements. Therefore it is often easier to reset these values so all elements look the same on all browsers and then apply them later as and when you need them!

In the most basic form you can just add this to the top of your CSS page


    * {
    padding:0;
    margin:0;
    }

But this then leaves you a bit stuck with some elements which need padding and margins (especially form elements!)

So in order to reset a few values so they all pretty normal (but importantly the same in all browsers!) add this too:



    * {
    padding:0;
    margin:0;
    }
    h1, h2, h3, h4, h5, h6, p, pre, blockquote, label, ul, ol, dl, fieldset, address { margin:1em 5%; }
    li, dd { margin-left:5%; }
    fieldset { padding: .5em; }

For more info on this check this site out (where I nicked the code from!)

http://leftjustified.net/journal/2004/10/19/global-ws-reset/

This entry was posted on Thursday, September 14th, 2006 at 5:05 pm and is filed under CSS, Development. You can leave a comment and follow any responses to this entry through the RSS 2.0 feed.

2 Comments Leave a comment

  1. Perl to check mount point…

    Here is a great Perl module that was posted in a comment to another Perl post by our good friend Justy (aka the iSheep), it solves a problem that I’ve faced a lot, especially with Perl scripts that run as daemons, where you need to copy files to …

  2. Rob 19 September 2006 at 2:10 pm #

    Looks like your spamming my site you bummer!

Leave a Reply