css - IE 7 和 IE 8 不使用 float :left on the same line if there is a table in one of the DIVs 渲染 2 个后续 div

标签 css internet-explorer html css-float

如果其中一个 DIV 中有一个 100% 宽度 + 非零边距的表格,IE 7 和 IE 8 不会在同一行上呈现 2 个带有 float:left 的后续 div:

<html>
<head>
<title>IE float left bug</title>
<style type="text/css">
.inttable
{
    width: 100%;
    margin: 9px;
}
.multicolumn 
{
    margin: 0px;
    border: 0px;
    padding: 0px;
    width:100%;
}
.column 
{
    margin: 0px;
    border: 0px;
    padding: 0px;
    float:left;
    display: inline;
}
</style>
</head>
<body>
<div class="multicolumn">
    <div class="column" style="width:50%;">
        <table class="inttable">
            <tr>
                <td>table1</td>
            </tr>
        </table>
    </div>
    <div class="column" style="width:50%;">
        column 2
    </div>
</div>
</body>
</html>

在FireFox、Opera、Chrome和Safari中没有这个问题。

有人知道这个 IE 错误的解决方法吗?

最佳答案

正如 scunliffe 在他的评论中提到的那样,使这个 html 过渡或严格的 xhtml 解决了这个问题。

关于css - IE 7 和 IE 8 不使用 float :left on the same line if there is a table in one of the DIVs 渲染 2 个后续 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1140273/

相关文章:

php - jquery 翻转在 IE 中不起作用

html - 在 IE7-8 中根本不应用 CSS 类

html - 在 Safari 上强制滚动条

javascript - 淡入图像,效果完成后,淡入旁边的另一个图像

html - 禁用自动文本突出显示输入?

javascript - 同位素 : Child elements inside button tag like image or span make button unclickable

css - 顶部 :expression(this. offsetParent.scrollTop-2);在 IE11 中不工作

html - IE 11 Bootstrap 3 下拉菜单的行高问题

javascript - 无法通过单击将 css 属性添加到 <td> 元素

html - 在不使用绝对定位的情况下将 div 定位在溢出滚动之外?