简体   繁体   English

尝试在Chrome vs FF / IE下实现自动高度div的相同功能

[英]Trying to achieve same functionality for auto-height divs under Chrome vs FF/IE

I have noticed a discrepancy between the heights of my divs in Chrome (which looks good) vs FireFox/IE. 我注意到Chrome中的div高度(看起来不错)与FireFox / IE之间存在差异。

Here's my HTML markup (I removed all the other tabs from this just to keep the code clean): 这是我的HTML标记(为了保持代码的干净,我从中删除了所有其他标签):

<div id="RightPane">
    <div id="RightPaneContent">
        <ul>
            <li><a href="#tabs-6">Plan View</a></li>
        </ul>
        <div id="tabs-6">
            <%= Html.Partial("PlanViewTab", Model) %>
        </div>
    </div>
</div>

#RightPaneContent
{
    min-width: 433px;
    height: 100%;
}

Here's how it looks under Google Chrome. 这是在Google Chrome浏览器下的外观。 Note how RightPaneContent expands to fill the entire height of viewport. 注意RightPaneContent如何扩展以填充视口的整个高度。

在此处输入图片说明

Here is how it looks under FireFox. 这是在FireFox下的外观。 Note how RightPaneContent did not expand to fill the entire viewport: 请注意,RightPaneContent如何无法展开以填充整个视口:

在此处输入图片说明

Does anyone have any advice on what steps I should take to achieve similiar functionality under both environments? 对于在两种环境下都应实现相似功能我应该采取什么步骤有任何建议吗? Or at least some reading material on what is happening here? 或至少有一些有关此处发生情况的阅读材料?

Per CSS spec, height: 100% means the same thing as height: auto if the parent is auto-height. 根据CSS规范, height: 100%表示与height: auto相同;如果父级为auto-height,则为auto。 Does your <div id="RightPane"> have a height specified? 您的<div id="RightPane">是否指定了高度? If not, chances are your page is in quirks mode, and WebKit just violates the standard slightly more in that mode than Gecko does. 如果不是这样,则您的页面很可能处于怪癖模式,并且WebKit在该模式下的违反程度比Gecko略高。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM