简体   繁体   English

CSS:在Firefox和IE中保持DIV的固定高度

[英]CSS : Maintaining fixed height for DIV in Firefox and IE

I have a master div and inside that i am showing multiple divs as a list.My HTML as below 我有一个主div,里面有多个div作为列表。我的HTML如下

<div id='divMasterContainer' style="height:200px;">
  <div id='child1'>
       // Some child contents here (Radio button / Button etc.. )
  </div>
  <div id='child2'>
    // Some child contents here (Radio button / Button etc.. )
  </div>
  <div id='child3'>
    // Some child contents here (Radio button / Button etc.. )
  </div>
</div>

So when rendering in firefox, ,The mastercontainer div is of height 200 px .But in IE , Its growing as of the number of child divs it holds. 因此,在firefox中进行渲染时,mastercontainer div的高度为200 px。但是在IE中,其随着所保存的子div的数量而增长。 I am using these div's with jFlow plugin to implement a slider control. 我将这些div与jFlow插件一起使用以实现滑块控件。 I want to mainitain the same height for the master div in both the browsers. 我想在两个浏览器中为master div保持相同的高度。 and i dont need a scrollbar in the master div too. 而且我也不需要master div中的滚动条。

您需要确保主div的“隐藏”溢出:

<div id='divMasterContainer' style="height:200px;overflow:hidden;">

也许您可以尝试在style标签中添加:

overflow:hidden;

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

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