我的 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; }
最佳答案
这些属性被 margin
和 padding
覆盖。
只需设置 margin: 0; padding: 0
如果你想要 margin
和 padding
消失。
这些属性不是突然出现的,而是一直存在的。
通过演示证明:http://jsfiddle.net/VNh3u/ - (显然,检查 WebKit 浏览器)
关于css - 摆脱用户代理样式表规则?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6528144/