Before Writing CSS
Practice of writing CSS is good for your website. One should always remember the following settings before writing CSS.
Firstly, set the margin and padding as zero, than for the image set the border as none. Once the border is set as none, than there is no need to set img tag border="0" in html. Also set the anchor tag default properties on top.
CSS
/*set body, ul, li, p and etc all element
margin and padding zero*/
*{
margin:0;
padding:0;
}
/*set image border none; therefore no need
to set border=0 in img element*/
img{
border:none;
}
/*If the site is table based set valing=top*/
td, th{
vertical-align:top
}
a{
text-decoration:none;
font-weight:bold;
color:red
}
a:hover{
text-decoretion:underline;
color:darkred;
}
a:visited{
color:#993333;
}
/*Set font color and type for font*/
body, p, h1, h2, h3, h4, h5, h6, ul, ol, li, div, td, th
{
color:# 333333;
font-family:verdana, arial, sens;
}
p{
line-height:1.4em;
margin-bottom:1em;
}
/*And font size*/
.style1, .style2,
..,
.. {
font-size:0.75em;/*Always use em unit*/
}
