Pixelbox

Welcome to Pixelbox. Thursday the 20 of November 2008

Skip to content >>

CSS Global white space reset

*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/
Meta tags: CSS, Development

2 comments

Why not leave your own!

  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. Looks like your spamming my site you bummer!

Add your own comment