css重置的各种版本总结

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了css重置的各种版本总结相关的知识,希望对你有一定的参考价值。

个人手机端常用到的:

@charset "utf-8";
body, h1, h2, h3, h4, h5, h6, hr, p, blockquote, dl, dt, dd, ul, ol, li, pre, form, fieldset, legend, button, input, textarea, th, td {
margin:0; padding:0 } body, button, input, select, textarea {font:12px/1.5 "\5FAE\8F6F\96C5\9ED1", arial ; *line-height:1.5} h1, h2, h3, h4, h5, h6 {font-size:100%; font-weight: normal;} address, cite, dfn, em, var {font-style:normal;} code, kbd, pre, samp {font-family:courier new, courier, monospace;} ul, ol {list-style:none;} fieldset, img {border:0} table {border-collapse:collapse;border-spacing:0;} input, button, textarea, select, optgroup, option {font-family: inherit;font-size: inherit;font-style: inherit;font-weight: inherit;

font-size:100%;} div:after, ul:after, dl:after,.clearfix:after { content:""; display:block; clear:both; height:0; visibility:hidden;} /****/ abbr, article, aside, audio, canvas, datalist, details, figure, footer, header, hgroup, menu, nav, output, progress, section, video {

display:block;margin:0;padding:0} i,u,b,em,span,small{ font-weight:normal; font-style:normal;} html,body {height: 100%} /****/ html {font-size: 62.5%;} body { -webkit-tap-highlight-color: rgba(255, 255, 255, 0); -webkit-user-select: none; user-select: none; -moz-user-focus: none; -moz-user-select: none; } a{text-decoration: none;} h2{ margin:0; padding: 0;}

个人PC端常用到的:

html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr,
acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike,
strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td
{ margin:0; padding:0; border:0; outline:0; font-size:100%; vertical-align:baseline; background:transparent } body { line-height:1 } ol, ul { list-style:none } blockquote, q { quotes:none } blockquote:before, blockquote:after, q:before, q:after { content:‘‘; content:none } :focus { outline:0 } ins { text-decoration:none } del { text-decoration:line-through } table { border-collapse:collapse; border-spacing:0 } .clear { clear: both; display: block; overflow: hidden; visibility: hidden; width: 0; height: 0; }

来源于51job的css代码重置:

@charset "utf-8";
/* Reset css*/
body,h1,h2,h3,h4,h5,h6,div,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{margin:0;padding:0}
body,button,input,select,textarea{font:12px/1.5 tahoma,arial,\5b8b\4f53}
body{_overflow:auto;_height:100%;margin:0 auto;}
html{_overflow:hidden}
h1,h2,h3,h4,h5,h6{font-size:100%}
address,cite,dfn,em,var{font-style:normal}
code,kbd,pre,samp{font-family:courier new,courier,monospace}
small{font-size:12px}
ul,ol,li,dl,dt,dd{list-style:none}
sup{vertical-align:text-top}
sub{vertical-align:text-bottom}
legend{color:#000}
fieldset,img{border:0}
button,input,select,textarea{font:12px/1.5 tahoma,arial,sans-serif; vertical-align:middle;cursor:pointer}
table{border-collapse:collapse;border-spacing:0}
.clear{display:block;float:none;clear:both;overflow:hidden;visibility:hidden;width:0;height:0;background:none;border:0;font-size:0}

/*a*/
a{ text-decoration:none; color:#555;}
a:hover{ color:#ff6600;}

/*title*/
h1 { font-size:50px;}
h2 { font-size:40px;}
h3 { font-size:30px;}
h4 { font-size:14px;}
h5 { font-size:12px;}
h6 { font-size:9px;}

来源于csdn的css代码重置

@charset "utf-8";
/* Download : http://www.codefans.net *?
/* Reset css*/
body,h1,h2,h3,h4,h5,h6,div,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td{margin:0;padding:0}
body,button,input,select,textarea{font:12px/1.5 tahoma,arial,\5b8b\4f53}
body{_overflow:auto;_height:100%;margin:0 auto;}
html{_overflow:hidden}
h1,h2,h3,h4,h5,h6{font-size:100%}
address,cite,dfn,em,var{font-style:normal}
code,kbd,pre,samp{font-family:courier new,courier,monospace}
small{font-size:12px}
ul,ol,li,dl,dt,dd{list-style:none}
sup{vertical-align:text-top}
sub{vertical-align:text-bottom}
legend{color:#000}
fieldset,img{border:0}
button,input,select,textarea{font:12px/1.5 tahoma,arial,sans-serif; vertical-align:middle;cursor:pointer}
table{border-collapse:collapse;border-spacing:0}
.clear{display:block;float:none;clear:both;overflow:hidden;visibility:hidden;width:0;height:0;background:none;border:0;font-size:0}

/*a*/
a{ text-decoration:none; color:#555;}
a:hover{ color:#ff6600;}

/*title*/
h1 { font-size:50px;}
h2 { font-size:40px;}
h3 { font-size:30px;}
h4 { font-size:14px;}
h5 { font-size:12px;}
h6 { font-size:9px;}

来源于淘宝的css重置

blockquote,body,button,dd,dl,dt,fieldset,form,h1,h2,h3,h4,h5,h6,hr,input,legend,li,ol,p,pre,td,textarea,th,ul {margin:0;padding:0}  
body,button,input,select,textarea { font:12px/1.5 tahoma,arial,‘Hiragino Sans GB‘,\5b8b\4f53,sans-serif}  
h1,h2,h3,h4,h5,h6 {font-size:100%}  
address,cite,dfn,em,var {font-style:normal}  
code,kbd,pre,samp {font-family:courier new,courier,monospace}  
small {font-size:12px}  
ol,ul {list-style:none}  
a {text-decoration:none}  
a:hover {text-decoration:underline}  
sup {vertical-align:text-top}  
sub {vertical-align:text-bottom}  
legend {color:#000}  
fieldset,img {border:0}  
button,input,select,textarea {font-size:100%}  
table {border-collapse:collapse;border-spacing:0}  

未知来源 css重置

html, body, div, span, applet, object, iframe, 
h1, h2, h3, h4, h5, h6, p, 
blockquote, pre, a, abbr, acronym, address, big, 
cite, code, del, dfn, em, font, img, 
ins, kbd, q, s, samp, small, strike, 
strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, 
fieldset, form, label, legend, 
table, caption, tbody, tfoot, thead, tr, th, td, 
center, u, b, i { 
    margin: 0; 
    padding: 0; 
    border: 0; 
    outline: 0; 
    font-weight: normal; 
    font-style: normal; 
    font-size: 100%; 
    font-family: inherit; 
    vertical-align: baseline 
} 
body { 
    line-height: 1 
} 
:focus { 
    outline: 0 
} 
ol, ul { 
    list-style: none 
} 
table { 
    border-collapse: collapse; 
    border-spacing: 0 
} 
blockquote:before, blockquote:after, q:before, q:after { 
    content: ¡°¡± 
} 
blockquote, q { 
    quotes: ¡°¡± ¡°¡± 
} 
input, textarea { 
    margin: 0; 
    padding: 0 
} 
hr { 
    margin: 0; 
    padding: 0; 
    border: 0; 
    color: #000; 
    background-color: #000; 
    height: 1px 
}}

个人感觉,css重置并不是说哪个好哪个不好,而是要针对自己的项目写一套适合自己的才是“王道”。

以上是关于css重置的各种版本总结的主要内容,如果未能解决你的问题,请参考以下文章

css 我经常忘记的各种CSS片段的集合。

css CSS重置以修复各种电子邮件客户端怪癖。

Tailwind.css 体验总结

Tailwind.css 体验总结

前端创建新项目时重置css

十条jQuery代码片段助力Web开发效率提升