webkit中2个浮动div之间的最小边距
有哪个 css 大师想对一个傻瓜进行这方面的教育吗?在 Chrome 中(我想 Safari 也是如此),我在 2 个浮动 div 之间得到了一个很小的边距(可能是 1px)。左侧div的宽度为58%,右侧div的宽度为42%。在 Firefox 中没有这样的边距。还没有尝试过 IE 或 Opera。使用 Chrome 的开发工具,我确实看到 p 有一个名为 -webkit-margin-before 和 -webkit-margin-after 的东西,它们被设置为 1em。我尝试覆盖它,但没有帮助。可能无关。有什么帮助吗?
链接到页面:http://www.audlibri.com
编辑:在 Opera 11 中确认了同样的问题。
Any css guru want to educate a simpleton on this one? In Chrome (and I presume Safari as well) I'm getting a small (maybe 1px) margin between 2 floating divs. Width of the left div is 58% and the right div is 42%. In Firefox there is no such margin. Haven't tried IE or Opera yet. Using Chrome's dev tool I did see that p has something called -webkit-margin-before and -webkit-margin-after which were set to 1em. I tried overriding that but it doesn't help. Probably unrelated. Any help?
Link to the page: http://www.audlibri.com
EDIT: confirmed same problem in Opera 11.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不幸的是,解决这个问题的最佳方法是设置
body { background:#XXX; }
与其中一列的颜色相同(#788081
或#B7B59B
)。希望他们没有真正需要彼此齐平。Unfortunately, the best fix to this problem is setting
body { background:#XXX; }
to the same color of one of those columns (#788081
or#B7B59B
). Hopefully there's no real need for them to be flush against each other.这是基于百分比的网页布局的子像素渲染问题。
这篇短文,作者:John Resig</a>(jQuery 名人),解释得非常清楚。
它有点过时了(2008 年 1 月),但我确信仍然适用。
It's a sub-pixel rendering problem with percent-based web layouts.
This short article by John Resig (of jQuery fame), explains it very clearly.
It's a little out of date (Jan 2008), but still applicable, I'm sure.