{"id":891,"date":"2012-10-12T10:30:36","date_gmt":"2012-10-12T02:30:36","guid":{"rendered":"http:\/\/www.poloo.org\/?p=891"},"modified":"2012-10-12T10:31:02","modified_gmt":"2012-10-12T02:31:02","slug":"%e5%90%84%e5%a4%a7%e9%97%a8%e6%88%b7%e7%9a%84css%e9%87%8d%e7%bd%aecss-reset","status":"publish","type":"post","link":"https:\/\/www.poloo.org\/?p=891","title":{"rendered":"\u5404\u5927\u95e8\u6237\u7684CSS\u91cd\u7f6e!(CSS reset)"},"content":{"rendered":"<p>\u5404\u5927\u95e8\u6237\u7684CSS\u91cd\u7f6e!(CSS reset)   <\/p>\n<p> \u6dd8\u5b9d\uff08www.taobao.com\uff09\uff1a   <\/p>\n<pre class=\"brush:css\">\r\n html {   \r\n overflow-x:auto;   \r\n overflow-y:scroll;   \r\n }   \r\n body, dl, dt, dd, ul, ol, li, pre, form, fieldset, input, p, blockquote, th, td {   \r\n font-weight:400;   \r\n margin:0;   \r\n padding:0;   \r\n }   \r\n h1, h2, h3, h4, h4, h5 {   \r\n margin:0;   \r\n padding:0;   \r\n }   \r\n body {   \r\n background-color:#FFFFFF;   \r\n color:#666666;   \r\n font-family:Helvetica,Arial,sans-serif;   \r\n font-size:12px;   \r\n padding:0 10px;   \r\n text-align:left;   \r\n }   \r\n select {   \r\n font-size:12px;   \r\n }   \r\n table {   \r\n border-collapse:collapse;   \r\n }   \r\n fieldset, img {   \r\n border:0 none;   \r\n }   \r\n fieldset {   \r\n margin:0;   \r\n padding:0;   \r\n }   \r\n fieldset p {   \r\n margin:0;   \r\n padding:0 0 0 8px;   \r\n }   \r\n legend {   \r\n display:none;   \r\n }   \r\n address, caption, em, strong, th, i {   \r\n font-style:normal;   \r\n font-weight:400;   \r\n }   \r\n table caption {   \r\n margin-left:-1px;   \r\n }   \r\n hr {   \r\n border-bottom:1px solid #FFFFFF;   \r\n border-top:1px solid #E4E4E4;   \r\n border-width:1px 0;   \r\n clear:both;   \r\n height:2px;   \r\n margin:5px 0;   \r\n overflow:hidden;   \r\n }   \r\n ol, ul {   \r\n list-style-image:none;   \r\n list-style-position:outside;   \r\n list-style-type:none;   \r\n }   \r\n caption, th {   \r\n text-align:left;   \r\n }   \r\n q:before, q:after, blockquote:before, blockquote:after {   \r\n content:\"\";   \r\n }   \r\n<\/pre>\n<p><!--more--><br \/>\n \u767e\u5ea6\u6709\u554a(www.youa.com)\uff1a\uff08\u67b6\u6784\u57fa\u672c\u4e0a\u662f\u6a21\u4effYUI\u6765\u505a\u7684\uff09   <\/p>\n<pre class=\"brush:css\">\r\n body {   \r\n font-family:arial,helvetica,sans-serif;   \r\n font-size:13px;   \r\n font-size-adjust:none;   \r\n font-stretch:normal;   \r\n font-style:normal;   \r\n font-variant:normal;   \r\n font-weight:normal;   \r\n line-height:1.4;   \r\n text-align:center;   \r\n }   \r\n body, ul, ol, dl, dd, h1, h2, h3, h4, h5, h6, p, form, fieldset, legend, input, textarea, select, button, th, td {   \r\n margin:0;   \r\n padding:0;   \r\n }   \r\n h1, h2, h3, h4, h5, h6 {   \r\n font-size:100%;   \r\n font-weight:normal;   \r\n }   \r\n table {   \r\n font-size:inherit;   \r\n }   \r\n input, select {   \r\n font-family:arial,helvetica,clean,sans-serif;   \r\n font-size:100%;   \r\n font-size-adjust:none;   \r\n font-stretch:normal;   \r\n font-style:normal;   \r\n font-variant:normal;   \r\n font-weight:normal;   \r\n line-height:normal;   \r\n }   \r\n button {   \r\n overflow:visible;   \r\n }   \r\n th, em, strong, b, address, cite {   \r\n font-style:normal;   \r\n font-weight:normal;   \r\n }   \r\n li {   \r\n list-style-image:none;   \r\n list-style-position:outside;   \r\n list-style-type:none;   \r\n }   \r\n img, fieldset {   \r\n border:0 none;   \r\n }   \r\n ins {   \r\n text-decoration:none;   \r\n }   \r\n<\/pre>\n<p> \u5728\u300a\u8d85\u8d8acss\u300b\u4e00\u4e66\u4e2d\u5efa\u8bae\u6211\u4eec\u505a\u7f51\u7ad9\u5f00\u59cb\u91cd\u7f6e\u6240\u6709\u9ed8\u8ba4\u6837\u5f0f\uff1a   <\/p>\n<pre class=\"brush:css\">\r\n \/\/ Normalizes margin,padding \/\/   \r\n body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,blockquote,th,td { margin:0;padding:0}   \r\n\r\n \/\/ Normalizes font-size for headers \/\/   \r\n h1,h2,h3,h4,h5,h6 { font-size:100%}   \r\n\r\n \/\/ Removes list-style from lists \/\/   \r\n ol,ul { list-style:none }   \r\n\r\n \/\/ Normalizes font-size and font-weight to normal \/\/   \r\n address,caption,cite,code,dfn,em,strong,th,var { font-size:normal; font-weight:normal }   \r\n\r\n \/\/ Removes list-style from lists \/\/   \r\n table { border-collapse:collapse; border-spacing:0 }   \r\n\r\n \/\/ Removes border from fieldset and img \/\/   \r\n fieldset,img { border:0 }   \r\n\r\n \/\/ Left-aligns text in caption and th \/\/   \r\n caption,th { text-align:left }   \r\n\r\n \/\/ Removes quotation marks from q \/\/   \r\n q:before,q:after { content:''}   \r\n<\/pre>\n<p> \u90a3\u6211\u4eec\u5b9e\u9645\u5199\u4ee3\u7801\u7684\u65f6\u5019\u8be5\u600e\u4e48\u6765css reset\u5462\uff1f<br \/>\n \u63a8\u8350\u4f7f\u7528\uff08Eric Meyer\u548cYUI\uff09\u7684 css reset   <\/p>\n<p> Eric Meyer&#8217;s Reset:   <\/p>\n<pre class=\"brush:css\">\r\n html, body, div, span, applet, object, iframe,   \r\n h1, h2, h3, h4, h5, h6, p, blockquote, pre,   \r\n a, abbr, acronym, address, big, cite, code,   \r\n del, dfn, em, font, img, ins, kbd, q, s, samp,   \r\n small, strike, strong, sub, sup, tt, var,   \r\n b, u, i, center,   \r\n dl, dt, dd, ol, ul, li,   \r\n fieldset, form, label, legend,   \r\n table, caption, tbody, tfoot, thead, tr, th, td {   \r\n margin: 0;   \r\n padding: 0;   \r\n border: 0;   \r\n outline: 0;   \r\n font-size: 100%;   \r\n vertical-align: baselinebaseline;   \r\n background: transparent;   \r\n }   \r\n body {   \r\n line-height: 1;   \r\n }   \r\n ol, ul {   \r\n list-style: none;   \r\n }   \r\n blockquote, q {   \r\n quotes: none;   \r\n }   \r\n blockquote:before, blockquote:after,   \r\n q:before, q:after {   \r\n content: '';   \r\n content: none;   \r\n }   \r\n\r\n \/\/ remember to define focus styles! \/\/   \r\n :focus {   \r\n outline: 0;   \r\n }   \r\n\r\n \/\/ remember to highlight inserts somehow! \/\/   \r\n ins {   \r\n text-decoration: none;   \r\n }   \r\n del {   \r\n text-decoration: line-through;   \r\n }   \r\n\r\n \/\/ tables still need 'cellspacing=\"0\"' in the markup \/\/   \r\n table {   \r\n border-collapse: collapse;   \r\n border-spacing: 0;   \r\n }   \r\n<\/pre>\n<p> YUI:   <\/p>\n<pre class=\"brush:css\">\r\n body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td {      \r\n      margin:0;     \r\n      padding:0;     \r\n }   \r\n table {   \r\n      border-collapse:collapse;     \r\n      border-spacing:0;     \r\n }   \r\n fieldset,img {      \r\n      border:0;     \r\n }   \r\n address,caption,cite,code,dfn,em,strong,th,var {   \r\n      font-style:normal;     \r\n      font-weight:normal;     \r\n }   \r\n ol,ul {   \r\n      list-style:none;     \r\n }   \r\n caption,th {   \r\n      text-align:left;     \r\n }   \r\n h1,h2,h3,h4,h5,h6 {   \r\n      font-size:100%;     \r\n      font-weight:normal;     \r\n }   \r\n q:before,q:after {   \r\n      content:'';     \r\n }   \r\n abbr,acronym { border:0;     \r\n }   \r\n<\/pre>\n<p> \u7ed3\u5408\u4ed6\u4eec\u7684css reset\u5199\u6cd5\uff0c\u518d\u6839\u636e\u81ea\u5df1\u7684\u5b9e\u9645\u60c5\u51b5\uff0c\u4e00\u5b9a\u80fd\u5199\u51fa\u7b26\u5408\u81ea\u5df1\u7f51\u7ad9\u7684\u5b8c\u7f8e\u7684css reset<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5404\u5927\u95e8\u6237\u7684CSS\u91cd\u7f6e!(CSS reset) \u6dd8\u5b9d\uff08www.taob&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,15],"tags":[90,138,63,78,52,139],"class_list":["post-891","post","type-post","status-publish","format-standard","hentry","category-Dream","category-Program","tag-css","tag-reset","tag-63","tag-78","tag-52","tag-139"],"_links":{"self":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts\/891","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=891"}],"version-history":[{"count":2,"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts\/891\/revisions"}],"predecessor-version":[{"id":893,"href":"https:\/\/www.poloo.org\/index.php?rest_route=\/wp\/v2\/posts\/891\/revisions\/893"}],"wp:attachment":[{"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=891"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=891"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.poloo.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=891"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}