Default values in CSS for browser compatibility

2:38 PM Posted by BlogTechno

Every browser has different margin and padding values that are set as default. Thats why we prefer to reset all values before building up a site. Most of people add,

* {margin:0; padding:0; border:0}

to the top of their CSS file to reset everything. But do you really thing that it is enough to reset everything? Use following code block on the top of your CSS file and see what else you’ve missed to reset.
a:link, a, a.visited
{ text-decoration:none; }
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form, fieldset,input,textarea,blockquote,th,td,p
{ margin:0; padding:0;}
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a, h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover, h5 a:hover, h6 a:hover { text-decoration:none; }
table { border-collapse:collapse; border-spacing:0; }
fieldset,img { border:0; }
address,caption,cite,code,dfn,em,strong,th,var
{ font-style:normal; font-weight:normal; }
ul,ol { list-style:none; }
caption,th { text-align:left; }
q:before,q:after { content:''; }
abbr,acronym { border:0; }


Related Posts :



0 comments:

Post a Comment