重置样式表的目标是减少浏览器在默认行高, 边距和标题字体大小等方面的不一致性; 重置样式经常出现在 CSS 框架中, 最初的 "meyerweb 重置" 也出现在 Blueprint http://code.google.com/p/blueprintcss/ 中.
这里给出的重置样式是有意非常通用的. 例如, 没有为 body 元素设置任何默认颜色或背景. 我并不特别建议您在自己的项目中以不变的状态使用它. 它应该被调整, 编辑, 扩展, 或者调整以匹配您的特定重置基线. 为页面, 链接等填充您喜欢的颜色.
换句话说, 这是一个起点, 而不是一个没有触感的独立黑匣子.
如果你想使用我的重置样式, 那么请随意! 这一切都是公开的 (我必须正式地说出来, 否则人们会问我有关许可的问题). 您可以获取文件的副本来使用, 并根据自己的需要进行调整. 如果你更喜欢复制粘贴, 或者只是想在页面内预览一下你将获得的内容, 请点击此处.
- /* http://meyerweb.com/eric/tools/css/reset/
- v2.0 | 20110126
- License: none (public domain)
- */
- 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, 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,
- article, aside, canvas, details, embed,
- figure, figcaption, footer, header, hgroup,
- menu, nav, output, Ruby, section, summary,
- time, mark, audio, video {
- margin: 0;
- padding: 0;
- border: 0;
- font-size: 100%;
- font: inherit;
- vertical-align: baseline;
- }
- /* HTML5 display-role reset for older browsers */
- article, aside, details, figcaption, figure,
- footer, header, hgroup, menu, nav, section {
- display: block;
- }
- body {
- line-height: 1;
- }
- ol, ul {
- list-style: none;
- }
- blockquote, q {
- quotes: none;
- }
- blockquote:before, blockquote:after,
- q:before, q:after {
- content: '';
- content: none;
- }
- table {
- border-collapse: collapse;
- border-spacing: 0;
- }
之前的版本
● v1.0(200802)
来源: http://www.css88.com/web/css/10458.html