css reset 整理

什么叫做css reset呢?即重置css,也就是重置默认样式。一些标签元素在HTML下有一个默认属性值,我们在写css页面的时候,为了避免在css中重复定义它们,我们需要重置默认样式(css reset)。

以前使用最多*{margin:0;padding:0},但其格式化太严重,慢慢被废弃。
国内大型门户如QQ,taobao等css reset时均有 yui的影子。
业内用的最多的还有 Erik Meyer’s CSS Reset

个人认为:应根据需求,量体裁衣。
综合yui,Erik,taobao我们就可以写出了自己的css reset。


参考文章:
1。 Reset CSS 研究(技术篇)
2。 Reset CSS研究(八卦篇)
3。 Erik Meyer’s CSS Reset
4。 YUI css reset

整理的css reset:

  1. /* reset */
  2. html{color:#000;background:#fff;}
  3. 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;}
  4. body{font:12px/1 Tahoma,Helvetica,Arial,"\5b8b\4f53",sans-serif;}
  5. img{border:none;}
  6. em,strong{font-style:normal;font-weight:normal;}
  7. li{list-style:none;}
  8. table {border-collapse:collapse;border-spacing:0;}
  9. h1{font-size:18px;}
  10. h2{font-size:16px;}
  11. h3{font-size:14px;}
  12. h4, h5, h6{font-size:100%;}

  13. q:before,q:after{content:'';}/* 消除q前后的内容 */
  14. button,input,select,textarea{font-size:100%;}/* 使得表单元素在 ie 下能继承字体大小 */
  15. input,button,textarea,select,optgroup,option{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;}
  16. address,cite,dfn,em,var{font-style:normal;} /* 将斜体扶正 */

  17. /* link */
  18. a{color:#36c;text-decoration:none;}
  19. a:hover{color:#f60;text-decoration:underline;}

复制代码
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值