css - 摆脱用户代理样式表规则?

标签 css google-chrome webkit reset

我的 Chome 12 中发生了一些奇怪的事情。

我几天前下载了最新的样板并在上面进行了设计。一切正常。

5 分钟前,Chrome (Webkit) 突然决定在我的设计中插入额外的 css 规则:

-webkit-margin-before: 1em;
-webkit-margin-after: 1em;
-webkit-margin-start: 0px;
-webkit-margin-end: 0px;
-webkit-padding-start: 40px;

如何在不添加额外重置的情况下摆脱它?

编辑:也遇到了 h1 元素的问题

-webkit-margin-before: 0.67em;
-webkit-margin-after: 0.67em;
-webkit-margin-start: 0px;
-webkit-margin-end: 0px;

Edit2:我的重置包含

html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup,
 var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, 
tfoot, thead, tr, th, td, article, aside, canvas, details, figcaption, figure, footer, 
header, hgroup, menu, nav, section, summary, time, mark, audio, video
 { margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline; }

最佳答案

这些属性被 marginpadding 覆盖。

只需设置 margin: 0; padding: 0 如果你想要 marginpadding 消失。

这些属性不是突然出现的,而是一直存在的。

通过演示证明:http://jsfiddle.net/VNh3u/ - (显然,检查 WebKit 浏览器)

关于css - 摆脱用户代理样式表规则?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6528144/

相关文章:

css - firefox 不将 css 转换应用于子元素

javascript - Firefox 网络浏览器中不显示确认消息

http - 为什么 Chrome 或 Safari 不能正确播放我的 MP3?

css - webkit 浏览器中输入元素的垂直填充无效

css - Zurb 基金会溢出

php - CSS 无法在 MAMP 上呈现

html - Twitter Bootstrap - 居中内容

google-chrome - 谷歌分析未在 Chrome 中加载

javascript - jQuery .on() 方法在 Chrome 中不起作用(但在 IE 和 FF 中起作用)

webkit - 在-webkit-image-set中使用border-image