css - 在 Firefox 中,表格边距不会折叠

标签 css firefox cross-browser margin

我做了 this fiddle来证明问题。表格边距在 Firefox 中不会折叠,而在 Chrome 和 IE 中会折叠。

火狐

Table margins don't collapse in Firefox

Chrome 和 IE

Table margins collapse in Chrome and IE

这个问题有解决办法吗?

最佳答案

Firefox 不是 collapsing vertical margin with table's 因为 http://www.fiveminuteargument.com/margin-collapse-tables

在表格中写display:block:

section, div, table {
    margin: 1em;
    display:block;
}

检查这个例子http://jsfiddle.net/fhhWd/2/

关于css - 在 Firefox 中,表格边距不会折叠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8240336/

相关文章:

html - Firefox:宽度百分比问题

AngularJs ng-disabled 在 IE 9 中不起作用任何解决方案?

html - CSS 过渡加速

jquery - 如何从链接悬停中滑出文本框

html - CSS - 在能够滚动的同时定位绝对溢出父级

firefox - 有什么方法可以禁用 Firefox 4 textarea-resizing 句柄?

jQuery循环: fading white text becomes "green" in Windows/Firefox/Cleartype Enabled

css - 有序列表不打印数字 1,而是打印所有其他数字。为什么?

css - 为什么我的 Joomla 模板无法在 Windows 7/Vista 的 IE9 中正确加载?

javascript - 手机版视频背景不完整