0

Is this valid CSS for browser reset? What does it do? I have been using this for a long time.

html,body,div,ul,ol,li,dl,dt,dd,h1,h2,h3,h4,h5,h6,pre,form,p,blockquote,fieldset,input,hr {margin:0; padding:0;}
h1,h2,h3,h4,h5,h6,pre,code,address,caption,cite,code,em,strong,th {font-size:1em; overflow:hidden; font-weight:normal; font-style:normal;}
ul,ol {list-style:none;}
fieldset,img,hr {border:none;}
caption,th {text-align:left;}
table {border-collapse:collapse; border-spacing:0;}
td {vertical-align:top;}
Asif
  • 716
  • 2
  • 15
  • 37
  • possible duplicate of [CSS reset - What exactly does it do?](http://stackoverflow.com/questions/11578819/css-reset-what-exactly-does-it-do) – Blazemonger Jul 10 '14 at 17:38

3 Answers3

4

This is a version of Eric Meyer's CSS reset. You can read about it here: http://meyerweb.com/eric/thoughts/2011/01/03/reset-revisited/

The goal of a reset stylesheet is to reduce browser inconsistencies in things like default line heights, margins and font sizes of headings, and so on.

And here's a history of why and how it came to life: http://sixrevisions.com/css/the-history-of-css-resets/

Misha Reyzlin
  • 13,736
  • 4
  • 54
  • 63
2

Yes, it's a type of CSS reset. It basically resets all the default spacing to zero and all the default alignments to left-top, as well as resetting the font sizes and weights of all the headers. The purpose of CSS resets is to make the website look consistent across all browsers.


I don't really like extensive CSS resets, though. Here's mine:

* {
    margin: 0;
    padding: 0;
}

img {
    border: none;
}

table {
    border-collapse: collapse;
}

It works fine.

Ry-
  • 218,210
  • 55
  • 464
  • 476
  • 1
    Is there any particular reason you use `border: none` instead of the equivalent but slightly shorter `border: 0`? – thirtydot Feb 21 '12 at 00:54
  • @thirtydot: I don't find `0` quite as clear. For minification, I do change it to `0`, though. – Ry- Feb 21 '12 at 00:55
0

I had a problem to use it with bootstrap wysihtml5 library. In fact when I try to use italic o bold style, it didnt work. To make it works I had to delete tag "i" and "b" from this file.