Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 分区';s在IE8中不对齐_Html_Css_Google Chrome_Firefox_Internet Explorer 8 - Fatal编程技术网

Html 分区';s在IE8中不对齐

Html 分区';s在IE8中不对齐,html,css,google-chrome,firefox,internet-explorer-8,Html,Css,Google Chrome,Firefox,Internet Explorer 8,我一直在试着让两个div挨在一起。但它在IE8上似乎不起作用,即使在Chrome版本35.0.1916.153M和Firefox 30.0上一切都很好 我所需要的就是一个主div,其中两个div相邻,并分布在整个屏幕上。我不需要任何左边或右边的空格 目前,它们彼此相邻,但宽度的百分比似乎不太合适。IE8需要将div-ifrm设置为100%,但chrome和Firefox会将其放在div-leftsidebar下面。当ifrm为84%时,Chrome和Firefox看起来很高兴,但ie8在旁边留下

我一直在试着让两个div挨在一起。但它在IE8上似乎不起作用,即使在Chrome版本35.0.1916.153M和Firefox 30.0上一切都很好

我所需要的就是一个主div,其中两个div相邻,并分布在整个屏幕上。我不需要任何左边或右边的空格

目前,它们彼此相邻,但宽度的百分比似乎不太合适。IE8需要将div-ifrm设置为100%,但chrome和Firefox会将其放在div-leftsidebar下面。当ifrm为84%时,Chrome和Firefox看起来很高兴,但ie8在旁边留下了一些位置

我在下面添加代码。请提供您的宝贵意见

谢谢

以下是html:

<div id="mainmasterdiv" class="pageXpress">
    <div id="leftsidebar">
</div>

    <div class="ifrm">
        <iframe id="iframe" frameborder="0" name="iframe" src="homepage.do" style="height: 524px;">
        </iframe>
    </div>
</div>

我没有在IE上测试,但我更正了一些属性,您可以看到所有代码:如果元素是浮动的,则不需要添加
display:block
。*我不需要任何左边或右边的空格。*所以我删除了左侧边栏上的左边距,并在iframe上添加了float right。我还重置了正文的默认边距,并使html和正文100%宽。这是你想要的吗?
另外,您可以在主div上添加
溢出:隐藏
以重置浮动。

样式没有问题,但iframe中的内容似乎缩小了,可能是因为固定宽度的内容


修复了所有问题后,现在看起来很好。

问题似乎出在iframe上,而不是ifrmi认为的那样,请尝试使用display:block。我在windows 7上尝试了IE8,它是ook,perharps你处于兼容模式?你能显示firefox/chrome的屏幕截图吗?不允许我添加图像,因为我是这个论坛的新成员使用像Tinypicher这样的文件上传网站
.pageXpress {
    cursor: pointer;
    display: block;
    font-size: 0.875em;
    font-weight: bold;
    height: 100%;
    padding: 0 0 5px;
    width: 100%;
}
div#leftsidebar {
    display: block;
    float: left;
    font-weight: 700;
    margin-left: 5px;
    min-height: 480px;
    text-align: left;
    width: 15%;
}
.ifrm {
    display: inline;
    height: 100%;
    position: relative;
    width: 100%;
}
#iframe {
    border: medium none;
    float: left;
    margin: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
    width: 84%;
}