CSS:在Firefox和IE中维护DIV的固定高度

时间:2009-10-09 05:32:14

标签: css internet-explorer firefox html

我有一个主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>

因此,当在firefox中渲染时,mastercontainer div的高度为200 px。但是在IE中,它的持续时间与子div的数量有关。我正在使用这些div与jFlow插件来实现滑块控件。我想在两个浏览器中维护主div的相同高度。我也不需要主div中的滚动条。

2 个答案:

答案 0 :(得分:2)

您需要确保主div有溢出'hidden':

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

答案 1 :(得分:1)

也许你可以尝试在样式标签中使用它:

overflow:hidden;