css - 对于任何元素,在 CSS 重置(以及 eric meyer 重置)中包含哪些其他内容会很好

标签 css

我知道并使用 eric meyer CSS reset,但是是否有更多的东西可以添加到 reset css 中?并且可以节省我们的时间并增加兼容性。

这是 default meyer 的最新 CSS 重置代码。

/* v1.0 | 20080212 */

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;
}

/* remember to define focus styles! */
:focus {
    outline: 0;
}

/* remember to highlight inserts somehow! */
ins {
    text-decoration: none;
}
del {
    text-decoration: line-through;
}

/* tables still need 'cellspacing="0"' in the markup */
table {
    border-collapse: collapse;
    border-spacing: 0;
}

我还添加了 a img {border:0} 与此重置。

最佳答案

我同意 Nick 的回答。您应该认真考虑使用 yahoo's reset (或其他一些有信誉的来源)。坦率地说,他们拥有比您更多的资源来在各种浏览器和环境中进行测试。随着新浏览器的出现,他们会保持更新。最后,您可以利用他们的免费超快 CDN:

<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?3.1.0/build/cssreset/reset-min.css">

关于css - 对于任何元素,在 CSS 重置(以及 eric meyer 重置)中包含哪些其他内容会很好,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2623360/

相关文章:

css - Google 字体不显示 Chrome 和 IE

css - 媒体查询不适用于 LENSA(Wordpress 主题)

javascript - 在js中更改类样式

css - 强制 Bootstrap 行占据页面的整个高度

javascript - CSS 规则未按预期应用

javascript - 折线图d3 js-x轴月

css - 网格 960 CSS 问题

javascript - 在 D3 中使用不同颜色更改每个堆叠条形图的颜色

javascript - 更新状态不更新 View

html - 在电子邮件中替代背景图像?