Firefox 9 (Mac) 解析边距有问题吗?
我当前的项目遇到了非常奇怪的问题。 #head
div 看起来像是启用了 margin-top
css 设置,但事实并非如此。仅在 Firefox 9.0.1 (Mac) 上出现,其他浏览器都可以。
这是演示布局的链接。不确定FF 9.0.1 Win版本是否会出现这种情况。但是,IE7 可以正确呈现它。请参阅附图以查看其呈现方式。因此,如果您在 Firebug 中禁用 #head
div 下的 margin-bottom:23px
,您会看到它会向上移动,但到底为什么!?这是我们禁用的 margin-BOTTOM
设置...
这是我,还是 FF?
I've got very weird problem in my current project. The #head
div looks like has margin-top
css setting enabled, while it is not. It only occurs on Firefox 9.0.1 (Mac), other browsers are ok.
Here's link to the demo layout. Not sure if it happens in FF 9.0.1 Win version. However, IE7 renders it correctly. Refer to attached image to see how it renders. So, if you disable the margin-bottom:23px
under the #head
div in Firebug, you'l see it'll move up, but why the heck!? It was the margin-BOTTOM
setting we've disabled...
Is this me, or is this FF?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这里发生的情况是底部边距与顶部边距折叠,结果全部被视为顶部边距。 CSS 规范要求这种行为,并且所有现代浏览器(当然不包括 IE7)都实现它。
What's happening here is that the bottom margin is collapsing with the top margin and the result is all being treated as top margin. The CSS spec requires this behavior, and all modern browsers (which doesn't include IE7, of course) implement it.
你总是可以把它放在你的样式表中。
检查它 - http://jsfiddle.net/nBWLq/2/。
you could always put this inside your stylesheet.
check it - http://jsfiddle.net/nBWLq/2/.