
正文
重置css样式,css重置代码
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
CSS reset重置样式有那么重要吗
是的;
因为各个浏览器都自带默认样式,而且默认样式还不一样。这样在写css的时候,你会发现,很难兼容所有浏览器。
有些浏览器自带padding值margin值。
相关问答
Q1: 比较简单的重置css样式技巧
html{color:#000;background:#FFF;}
body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}
table{border-collapse:collapse;border-spacing:0;}
fieldset,img{border:0;}
address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:400;}
li{list-style:none;}
caption,th{text-align:left;}
h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:400;}
q:before,q:after{content:'';}
abbr,acronym{border:0;font-variant:normal;}
sup{vertical-align:text-top;}
sub{vertical-align:text-bottom;}
input,textarea,select{font-family:inherit;font-weight:inherit;font-size:100%;}
legend{color:#000;}
//Yahoo css reset 3.0版本
这是我使用了四年的CSS Reset,你可以适当的根据自己的项目添加一些自己的.
希望能够采纳 .^_^.
Q2: CSS 如何恢复到默认样式?
默认好像就是没有的,那就只有再重新定义一个css来控制它,要么就直接删掉,不引用css






