1.
charset ”utf-8″; html {background:url(/www/pic/head_back.gif) repeat-x top #FFF} body {width:920px;font:12px Arial;margin:0 auto;padding:0;color:#000;} a{color:#000; text-decoration:none} a:hover {color:#f00; text-decoration:underline} ul,ol,p,dl{margin:0;padding:0} ul,ol,dl{height:100%;overflow:hidden} li{list-style:none} img {border:none} h1,h2,h3,h4{font:12px Verdana;margin:0;padding:0} input {font:12px Verdana} 2. /*为背景定义了颜色*/ 最后不知道谁给出了Erik Meyer的Css Reset,给人感觉确实不错,着也应该是大家使用最多的: 程序代码
html, body, div, span, applet, object, iframe, table, caption, tbody, tfoot, thead, tr, th, td,
del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, dl, dt, dd, ol, ul, li, fieldset, form, label, legend { vertical-align: baseline; font-family: inherit; font-weight: inherit; font-style: inherit; font-size: 100%; outline: 0; padding: 0; margin: 0; border: 0; } /* remember to define focus styles! */ :focus { outline: 0; } body { background: white; line-height: 1; color: black; } ol, ul { list-style: none; } /* tables still need cellspacing="0" in the markup */ table { border-collapse: separate; border-spacing: 0; } caption, th, td { font-weight: normal; text-align: left; } /* remove possible quote marks (") from <q> & <blockquote> */ blockquote:before, blockquote:after, q:before, q:after { content: ""; } blockquote, q { quotes: "" ""; } 最后经过大家对Erik Meyer的Css Reset的讨论,认为还可以修改,最后得出了下面的结果感觉是不是又简洁了点,不过效果都一样哦: 程序代码
body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6,
pre, form, fieldset, input, textarea, p, blockquote, th, td { padding: 0; margin: 0; } fieldset, img { border: 0; } table { border-collapse: collapse; border-spacing: 0; } ol, ul { list-style: none; } address, caption, cite, code, dfn, em, strong, th, var { font-weight: normal; font-style: normal; } caption, th { text-align: left; } h1, h2, h3, h4, h5, h6 { font-weight: normal; font-size: 100%; } q:before, q:after { content: ''; } abbr, acronym { border: 0; } } |