重置好你的样式(reset.css)?

来源:11-6 Responsive布局技巧

yyc大win

2014-12-05 13:57

什么意思,怎么做?

写回答 关注

1回答

  • mrtwenty
    2014-12-05 19:45:21
    已采纳

    不同的浏览器对 标签有不同的解析方式,所以 哪怕是同一个标签,在不同的浏览器上都有不同的外边距、内边距、字体等的差异。

    最简单的重置

    *{margin:0;padding:0;}

    复杂的重置:

    body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,
    form,fieldset,input,textarea,p,blockquote,th,td {
    padding: 0;
    margin: 0;
    }
    table {
    border-collapse: collapse;
    border-spacing: 0;
    }
    fieldset,img {
    border: 0;
    }
    address,caption,cite,code,dfn,em,strong,th,var{
    font-weight: normal;
    font-style: normal;
    }
    
    ol,ul {
    list-style: none;
    }
    caption,th {
    text-align: left;
    }
    h1,h2,h3,h4,h5,h6 {
    font-weight: normal;
    font-size: 100%;
    }
    q:before,q:after {
    content:'';
    }
    abbr,acronym { border: 0;
    }

    放在你写的样式之前。



    yyc大wi...

    非常感谢!

    2014-12-09 08:59:04

    共 1 条回复 >

十天精通CSS3

本课程为CSS3入门教程,深刻详解CSS3知识让网页穿上绚丽装备

242220 学习 · 2623 问题

查看课程

相似问题