您的位置:首页 > Web前端 > CSS

css样式重置

2016-07-03 16:22 447 查看
作为一名切图仔,经常会遇到头疼的各大浏览器兼容性问题,确切的说是兼容它们“默认”的CSS样式表。重置样式成为我们为我们的网页梳妆打扮的第一步,也是关键性的一步。

以前我这样重置样式:

*{
margin:0;
padding:0;
}


后来通过看一些大神的博客以及查阅相关资料发现,上面的方式会让网页解析的很慢,于是我根据自己的需求,这样重置样式:

body,html,div,blockquote,img,label,p,h1,h2,h3,h4,h5,h6,pre,ul,ol,li,dl,dt,dd,form,fieldset,input,th,td{
margin:0;
padding:0;
border:0;
outline:none;
}
body{
line-height:1;
fontsize:88%;
}
h1,h2,h3,h4,h5,h6{
font-size:100%;
font-weight: normal;
}
ul,ol{
list-style: none;
}
address,caption,cite,code,dfn,em,strong,th,var{
font-style:normal;
font-weight: normal;
}
caption,th{
text-align:left;
}
a{
color:#ffffff;
text-decoration: none;
}
a:hover{
text-decoration:underline;
}


相关文章
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: