html - 为什么此页面无法在 Internet Explorer 中正确呈现?

标签 html css internet-explorer rendering

看看这个页面: http://labs.pieterdedecker.be/hetoog/layout.htm

它在 Firefox 中看起来不错,但 IE 却搞砸了。怎么会?

最佳答案

您的布局有点有趣。不要在页面的任何一侧使用空表格单元格,您可以将它们取出并使用

body {
    width: 750px;
    margin: 0 auto;
}

你的 HTML 可能是这样的:

<body>    
    <table>
        <tr>
            <td class="splash_desc">...</td>
            <td class="splash_photo">...</td>
        </tr>
        ...

使用这种方法,IE 不会比其他浏览器占用更多空间,并且可以很好地适应 750 像素宽的容器。

编辑:

要使标题栏水平拉伸(stretch) 100%,您必须为内容制作另一个 div。因此,不要使用 body 元素来设置宽度,而是使用如下内容:

<body>
    <table id="header"><tr>...</tr></table>
    <div id="wrapper">    
        <table>
            <tr>
                <td class="splash_desc">...</td>
                <td class="splash_photo">...</td>
            </tr>
            ...

在 CSS 中:

#wrapper {
    width: 750px;
    margin: 0 auto;
}

这样你就可以让 wrapper 上方的表格为 100% 宽(只要这样设计),而 wrapper 本身是 750px 宽。

关于html - 为什么此页面无法在 Internet Explorer 中正确呈现?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1851979/

相关文章:

html - 边界半径 Firefox 不工作

html - 单击具有 CSS 列的列表中的按钮会更改列

css - moz-transition - 翻转其他对象时更改文本

jquery - 有没有办法使用 animate.css 循环组合动画?我正在尝试弹跳/滑动单词并让它们弹跳

javascript - 测试对 window.opener.document 的访问

html - Chrome 自动填充不正确的数据类型

html - 我不想将 HTML 文件名显示为主页,例如 stackoverflow.com,而不是 stackoverflow.com/home

单击 div 但不是其嵌套 div 时的 jquery 函数

html - FireFox - Blinky Hover Div

css - VW 在 IE9 中无法正常工作