CSS: how to reset default value in a multi browsers scope ?

Already have to produce web page to public target ??? And by public i mean out of intranet or extranet of the world of enterprise, targetting any public.

Yes ?

So the first thing to do before creating a CSS styles sheet is to start from the same point for all browser. And as all CSS specification version didn’t tell a word about what are the default values, all browser developers go with there own randomly choosen values 😉

A first solution
So, it’s mandatory to reset these values to be sure that your CSS will have chance to produce the same visual result on all web client of the world, any OS, any browser.

The first technic is to reset individualy all html tags to some common values:

html, body, div, form, fieldset, legend, label {
???? margin: 0;
???? padding: 0;

table {
???? border-collapse: collapse;
???? border-spacing: 0;

th, td {
?? text-align: left;
?? vertical-align: top;

h1, h2, h3, h4, h5, h6, th, td, caption { font-weight:normal; }

img { border: 0; }

Quick and dirty ?
The second
technic is to reset with a one big line

* {
?? vertical-align: baseline;
?? font-weight: inherit;
?? font-family: inherit;
?? font-style: inherit;
?? font-size: 100%;
?? border: 0;
?? padding: 0;
?? margin: 0;


Thanks to « Carrer Blog : CSS Mini Reset » for this very fast solution covering 80% rules.

Other solutions exists :


Les commentaires sont fermés.

Propulsé par WordPress.com.

Retour en haut ↑

%d blogueurs aiment cette page :