CSS适用于Chrome,但不适用于FF或IE

时间:2013-06-13 03:40:32

标签: css html displaytag

我在Chrome网站www.habitacionalkids.com.ar上有以下HTML / css简单代码没有问题,但是当我在FF或IE上打开它时,我有一个div缺失。我在其他网站上使用非常相似的代码并且工作正常但我不知道为什么不在这里工作。

CSS

html, body, #wrapper, images {
    height:100%;
    width: 100%;
    margin: 0px;
    padding: 0px;
    border: 0px;
    background-color:#143d36;
}

img {
    margin: 0px;
    padding: 0px;
    border: 0px;
    display: block;
  /*display: inline-block;*/
}

.center {
   width: 800px;
   height: 600px;
   position: absolute;
   left: 50%;
   margin-left: -400px;
}
.center_mini{
    margin: 0px;
    padding: 0px;
    border: 0px;

}
.center_mini_float{
    float:left;
    margin: 0px;
    padding: 0px;
    border: 0px;

}

HTML

<div class="center">
    <div class="center_mini">
        <img src="images/img_01.png" width="800" height="470" alt="bg">
  </div>
  <div class="center_mini">
      <div class="center_mini_float">
        <img src="images/img_02.png" width="364" height="130" alt="bg">
      </div>
      <div class="center_mini_float">
        <div class="center_mini">
          <div class="center_mini_float">
            <a href="https://www.facebook.com/HabitacionalKids?fref=ts" target="_blank"><img src="images/img_03.png" width="35" height="33" alt="bg"></a>
          </div>
          <div class="center_mini_float">
            <a href="mailto:hola@habitacionalkids.com.ar"><img src="images/img_04.png" width="34" height="33" alt="bg"></a>
          </div>
        </div>
        <div class="center_mini">
          <img src="images/img_06.png" width="69" height="97" alt="bg">
        </div>              
      </div>
      <div class="center_mini_float">
          <img src="images/img_05.png" width="367" height="130" alt="bg">
      </div>
  </div> 
</div>

3 个答案:

答案 0 :(得分:3)

似乎缺少的div只是漂浮在其兄弟的右边而不是它的下面。尝试添加:

.center_mini {
    clear: both;
}

答案 1 :(得分:2)

用于Overflow:hidden;,就像这样

.center_mini{overflow:hidden;}

,第二个选项是

.center_mini:after {
    clear: both;
    content: "";
    display: table;
    overflow: hidden;
}

答案 2 :(得分:0)

这将为您解决问题。将这行代码添加到您的CSS中。

.center_mini img{
        float:left;
}
相关问题