1. 程式人生 > >css重置的各種版本總結

css重置的各種版本總結

button 自己的 aps load ica 手機端 small logs job

個人手機端常用到的:

@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重置的各種版本總結