0

Why exactly do some websites have a reset CSS section at the beginning of their CSS file? I keep reading that it helps cross browser compatibility, but what exactly does that mean? Just curious, thanks!

evanslove
  • 61
  • 1
  • 2

3 Answers3

1

CSS resets are used, in the words of Eric Meyer,

to reduce browser inconsistencies in things like default line heights, margins and font sizes of headings, and so on.

When presented with a page with no CSS, a browser will attempt to render it with its own built-in default style. These may look similar, but they're often different under the hood, sometimes in maddening ways that manifest when one tries to combine a specific browser's style with the desired effect, only to find that combination is different with another browser.

Resets attempt to "level the playing field" and set a baseline for everything, so that the site-specific CSS layered on top then has a similar effect across the different rendering engines in use on the Web.

Mattie
  • 20,280
  • 7
  • 36
  • 54
0

Because historically, different browsers would have their own set of default ways to render certain elements. As a result your un-CSSed HTML would have different renderings depending on what set of default CSS you are depending on. Hence a 'reset' to normalize all broswers.

Octopus
  • 8,075
  • 5
  • 46
  • 66
0

it actually ride off all default style of all the html elements and allow you to define your own style for each element but doing so you will get consistent style of your page across all the browser. Please note each browser treat html element by it's own way if css reset is not used. hope this help!

Kingk
  • 995
  • 11
  • 13