父div小于子div?

时间:2012-06-20 19:13:04

标签: css html wrapper

这是我的问题,我想用白色填充content div。但是当我这样做时,它没有填满整个div。子div更大,它们越过父div(内容)。我希望内容div涵盖所有的孩子div。

这是我的代码

#content {
  width: 100%;
  min-height: 400px;
  height: auto;
  max-height: 2000px;  /* ONLY FOR THE MOMENT */
  margin-top: -7px;
  background:white;
}
#fastMenu {
  float:left;
  width: 200px;
  height: 100%;
  margin-top: 20px;
}
#contenu {
  float:left;
  width: 430px;
  height: 100%;
  margin-top: 20px;
  background:white;
}
<div id = "content">
  <div id = "fastMenu">
    <a href="conseil-d-administration">
      <img src="<?php echo 'http://dev201.viglob.gtvr.com/client_file/themes/default/interface/FR/menuAdmin.png'; ?>" border="0" />
    </a>
    <a href="congres-2012">
      <img src="<?php echo 'http://dev201.viglob.gtvr.com/client_file/themes/default/interface/FR/menuCongres.png'; ?>" border="0" />
    </a>
    <a href="formation">
      <img src="<?php echo 'http://dev201.viglob.gtvr.com/client_file/themes/default/interface/FR/menuFormation.png'; ?>" border="0" />
    </a>            
    <a href="devenir-membre">
      <img src="<?php echo 'http://dev201.viglob.gtvr.com/client_file/themes/default/interface/FR/menuMembre.png'; ?>" border="0" />
    </a>            
  </div>  
  <div id="contenu" class="txt"></div>
</div> 

我还想要一个跨浏览的答案(IE7,IE8,IE9,Firefox,Chrome,Opera)

1 个答案:

答案 0 :(得分:45)

overflow: auto添加到.content

的css中
相关问题