Skip to content

Pilmore, Lee

Reset your CSS

Filed under CSS on September 6th, 2006 |

One small problem we face when writing our CSS and we really need to refine certain elements, like type selectors, is the rendering differences across browsers. Life is to short to go into how browser X defines margins around headings compared to browser Y, we know slight default browser fluctuations exist, so one way to move this problem to one side and forget about it is to reset all default styles.

The Yahoo Development Network call this cross-browser normalization of the default rendering of HTML elements and it seems like a sensible way to begin the process of writing our CSS. Standardise all A-grade browsers, leveling the playing field, then write on top of this. Check out Yahoo’s Reset CSS.

There are also details specifically on cross-browser typographical normalization and control at Yahoo’s Fonts CSS which:

  • Offers full A-grade browser support.
  • Provides consistent font sizing and line-height.
  • Provides appropriate cross-OS font-family degradation paths.
  • Supports user-driven font-size adjustment in the browser, including cross-browser consistency for adjusted sizes.
  • Works in both “Quirks Mode” and “Standards Mode.”
  • Normalizes the dimensions of an “em” unit, facilitating liquid-dimension development.

Like I say, level the ground with some simple foundations and enjoy a safer build with less surprises!

Picture house

Coming from Flickr

Diversions