Cross browser element spacing

  • Post author:
  • Post category:Uncategorized

I’ve long believed that Sandra Clark is the queen of CSS design. Today on the ColdFusion mailing list CF-Talk, she posted this awesome tip. Are you seeing differences in spacing on page elements between browsers? Here’s her suggestion:”Each browser has its own style sheet which sets (among other things) default margins and padding for each element. The best way I have found to combat this is to specifically zero out all margins and paddings from all elements first and explicitly set them up as necessary.h1,h2,h3,h4,h5,h6,p,ul,li,br,table,div,ol,a { margin:0; padding:0;}It involves a bit more work, but I have found it creates more consistency between browsers.”