关注前端开发
关注用户体验

发个自己的CSS重置基础代码

关于css的重置代码有很多,也有不少人写过适合不同站点的重置代码,这里发个浩子平时使用的额方法。

代码如下:

/* haozi / hao.chen@qq.com / 2011.06.15 */
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,blockquote,th,td,p{margin:0;padding:0}
input,button,select,textarea{outline:none}li{list-style:none}img{border:none}textarea{resize:none}
body{color:#666;background:#fff;word-break:break-all;word-wrap:break-word;text-align:center}
body,input,textarea{font-size:12px;font-family:\5b8b\4f53,Verdana,Arial}
a{color:#305999;text-decoration:none;outline:none}
a:hover{color:#090}
.wrap{width:1000px;margin:0 auto;text-align:left;position:relative}
/*clearfix*/
.clearfix:after,.wrap:after{content:".";display:block;height:0;clear:both;visibility:hidden}
.clearfix,.wrap{*+height:1%}

话说这两天文章发布频率下降,给大家道个歉,接下来将要写几篇有关css性能的文章,还请各位收听@浩子已获得最新文章资源。

赞(1)
未经允许不得转载:大前端 » 发个自己的CSS重置基础代码
分享到: 更多 (0)

评论 39

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  1. #27

    Yangın kapısı denince akla ilk reddoor Yangın Çıkış Kapıları Gelmektedir. sizi web sitemize beklerim. Yangın Merdiveni Kapısı İstanbul Bahçelievler Yangın Çıkış Kapısı

  2. #26

    dining room furnitures should be coated with shellac or varnish in order to preserve the wood grains::

  3. #25

    If only my personal content articles appeared as if this particular! That is a enhance, btw?-I ‘m new to blog posting and reading numerous blog posts is helping me out with my very own. Any kind of info you could throw my method to assistance is very appreciated. Just good information on this particular post!

  4. #24

    All three guys hate their jobs and two of the three are involved in blackmail, leading them to their next possible choice: kill each other’s bosses.

  5. #23

    I have to say which i slightly disagree, but no biggie.

    Nonton Anime2周前 (05-11)回复
  6. #22

    Paris Hilton: So lovely spending time with Manny and h

    cat products2周前 (05-08)回复
  7. #21

    My personal sis recommended me personally about your own internet website and exactly how excellent it really is. She’s correct, I’m really impressed with the writing and clever design. It appears in my experience you are merely itching the surface when it comes to what you might achieve, nevertheless you’re on a good begin!

    situs poker2周前 (05-05)回复
  8. #20

    Enjoyed the post.

  9. #19

    I was also reading a topic like this one from another site.~”-..

    Porter Currence1个月前 (04-08)回复
  10. #18

    After I originally left a comment I appear to have clicked the -Notify me when new comments are added- checkbox and now every time a comment is added I get four emails with the same comment. Is there an easy method you can remove me from that service? Thanks a lot!

    DMC52个月前 (03-31)回复
  11. #17

    Hey, you used to write magnificent, but the last several posts have been kinda boring… I miss your tremendous writings. Past several posts are just a little out of track! come on!

    my singing monsters2个月前 (03-28)回复
  12. #16

    Aw, this became a very good post. In concept I must set up writing like this moreover – taking time and actual effort to produce a really good article… but exactly what can I say… I procrastinate alot and by no indicates apparently go completed.

    Lorenzo Night2个月前 (03-11)回复
  13. #15

    我经常用*{margin:0; padding:0;}来定义全局边距,听说不太好是吗?我感觉挺实用啊

    小常5年前 (2014-05-12)回复
    • 其实,目前浏览器市场来说,这个不是什么大的问题了

      浩子5年前 (2014-05-27)回复
  14. #14

    不错,简洁。

    yooly7年前 (2012-05-03)回复
  15. #13

    很不错啊,我也对这个做了不少研究,大体上一样了,不过你这里把.wrap也默认设置了清除浮动不错,我喜欢,借用了啊

    CloudYan7年前 (2012-04-19)回复
  16. #12

    这个东东不错,很实用的,我也综合了几个CSS框架,写了自己的css reset

    浩安8年前 (2011-12-13)回复
  17. #11

    我是几大门户都抄袭了下!

    agen8年前 (2011-11-29)回复
  18. #10

    浩子兄,站内的东东很好哦 😛
    刚才看 上文的代码展示 超出它的父元素了 , 我是用火狐浏览的……呵呵……

    小T8年前 (2011-09-03)回复
    • 这个,我还真没注意,看看去,我使用的是chrome

      浩子8年前 (2011-09-05)回复
      • 他说的是代码去没有加折断换行,css reset第一行blockquote之后超出父元素了

        cloudyan7年前 (2012-04-19)回复
  19. #9

    我一直用的是淘宝的。你这里面少着对html5的支持啊。

    wmtimes8年前 (2011-07-19)回复
    • 一行block是吧,哈哈,d4没有用到html5标签,因为会多加载一点js

      浩子8年前 (2011-07-20)回复
      • 那到是,为了个破ie6加载些js很不划算。

        wmtimes8年前 (2011-07-29)回复
  20. #8

    div,dt也需要重置? 👿

    i-designers8年前 (2011-07-19)回复
  21. #7

    话说css我还不太懂,别说重置了,狂补 😉

    奚少8年前 (2011-06-28)回复
  22. #6

    css重置还真没玩过 😎

    liveme8年前 (2011-06-17)回复
    • 可以避免掉不少兼容性问题奥

      ADD~``8年前 (2011-06-17)回复
      • 是的,基本的css写好了,可以大胆的写个别性css

        浩子8年前 (2011-06-17)回复
    • 哈哈,这个要知道滴,哥们

      浩子8年前 (2011-06-17)回复
  23. #5

    收藏了,每次都是自己手写!

    Way-2011渐行渐远8年前 (2011-06-17)回复
  24. #4

    重置是什么意思呢?

    John8年前 (2011-06-16)回复
    • 把html标签自带的属性值清空……方便自定义数值,有利于排版布局。

      bamboo7年前 (2012-01-11)回复
  25. #3

    也开个新浪微博呗..

    ADD~``8年前 (2011-06-16)回复
  26. #2

    .wrap 是啥东东呀?这也放在 css reset 里吗? 😉

    万戈8年前 (2011-06-16)回复
    • 哈哈,自己设置宽度的,省事儿

      浩子8年前 (2011-06-16)回复
  27. #1

    我来看博主文章了,感谢分享哦!!!

    重庆时时彩技巧8年前 (2011-06-16)回复

themebetter 国内更好的WordPress主题服务商

立即前往