IE和Firefox之间的表行高度差异 [英] Table row height difference between IE and Firefox
本文介绍了IE和Firefox之间的表行高度差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我提取了以下代码并删除了大量HTML和CSS,以便我可以隔离问题。从本质上讲,IE做了我期望的(!!)和其他浏览器使行高度比我预期的大得多(足够的空白用于3行文本)。这是HTML:
I have extracted the following code and eliminated a lot of HTML and CSS so that I can isolate a problem. Essentially, IE does what I expect (!!) and other browsers make the row height much larger than I expect (enough white space for 3 rows of text). Here''s the HTML:
展开 | 选择 | Wrap | 行号
推荐答案
将您的文档类型更改为此:
Change your doc type to this:
展开 | 选择 | Wrap | 行号
首先,在xhtml中,大小写很重要,所以将标签放在小写字母中。
此外,你的meta缺少结尾斜杠/>。 xhtml需要这个。
行崩溃的原因是因为< p>的边距。不复存在。要解决此问题,请将所有边距设置为零,并在需要时添加它们。 * {margin:0}这也减轻了浏览器之间默认边距不同的问题。
First of all, in xhtml, case matters so put your tags in lower case.
Also, your meta is missing the ending slash />. xhtml requires this.
The reason the row collapses is because the margins from the <p> no longer exist. To get around this, set all your margins to zero and add them where needed. *{margin:0} This also alleviates problems where default margins are different between browsers.
这些是有趣的想法,但它们似乎没有改变任何东西。这就是我现在所拥有的:
Those were interesting ideas but they do not appear to have changed anything. Here''s what I have now:
展开 | 选择 | Wrap | 行号
这篇关于IE和Firefox之间的表行高度差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文