css reset样式初始化/重置默认样式

写过css的都知道每个网页引进的css都首先要初始化,而出名的css reset有YUI css reset(QQ、淘宝等都出现他的影子),业内用的最多的还有Erik Meyer’s CSS Reset

整理一下可以得到:

/* reset */
html{color:#000;background:#fff;}
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,input,button,textarea,p,blockquote,th,td{margin:0;padding:0;}
body{font:12px/1 Tahoma,Helvetica,Arial,"\5b8b\4f53",sans-serif;}
img{border:none;}
em,strong{font-style:normal;font-weight:normal;}
li{list-style:none;}
table {border-collapse:collapse;border-spacing:0;}
h1{font-size:18px;}
h2{font-size:16px;}
h3{font-size:14px;}
h4, h5, h6{font-size:100%;}
q:before,q:after{content:'';}/* 消除q前后的内容 */
button,input,select,textarea{font-size:100%;}/* 使得表单元素在 ie 下能继承字体大小 */
input,button,textarea,select,optgroup,option{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;}
address,cite,dfn,em,var{font-style:normal;} /* 将斜体扶正 */
/* link */
a{color:#36c;text-decoration:none;}
a:hover{color:#f60;text-decoration:underline;}

感谢蓝色理想的 putao899会员的整理

3 Responses to css reset样式初始化/重置默认样式 »

  1. 万戈 评论 2009-10-12 11:53

    CSS没有系统的学过,从你这里学习了不少啊

    回复

  2. 万戈 评论 2009-10-12 11:58

    对了,我的站名是Life Studio,不是Live Studio,麻烦你改一下哟,谢谢啦

    回复

    joe 回复 十月 12th, 2009 at 12:00

    :( sorry搞错了,改回来了

    回复

Leave a Reply

Email address is not published

You should say a Chinese word to pass spam check. If you can not input Chinese, just copy 你好 and paste them into comment text box.