溢出:隐藏在IE中不会隐藏边框下方的图像

时间:2011-01-20 15:13:46

标签: html internet-explorer overflow

我正在尝试使用一些基本的图像将图像滑入我的主容器中 页面加载时的JavaScript。

我设置了溢出:隐藏在我的容器div上,因此图像不能 直到它真正撞到容器时才看到。

问题是在IE中似乎没有包含溢出边框:隐藏, 所以当它滑过边界时,图像看起来很可怕。无论如何围绕这个? 我在其他浏览器中没有问题。

我的原始代码:

#container{
 border: 5px solid #3A3535;
 width: 960px;
 margin: 0 auto;
 -moz-border-radius: 12px;
 -webkit-border-radius: 12px;
 border-radius: 12px;
 padding: 10px 20px 0;
 background: #fff;
 overflow: hidden;
 position: relative;
}

更新: 我确实设法让它发挥作用。我将容器包裹在div中,从中移除边框 容器,并添加边框到包装器。修复它,虽然我不知道为什么。

#wrapper{
    width: 1000px;
    position: relative;
    margin: 40px auto;
    border: 5px solid #3A3535;
    -moz-border-radius: 16px;
   -webkit-border-radius: 16px;

   border-radius: 16px;
}
#container{
 width: 960px;
 margin: 0 auto;
 -moz-border-radius: 12px;
 -webkit-border-radius: 12px;
 border-radius: 12px;
 padding: 10px 20px 0;
 background: #fff;
 overflow: hidden;
 position: relative;
}

2 个答案:

答案 0 :(得分:0)

div.something {
    width: 200px;
    overflow: hidden;
}

尝试设置宽度或高度以使溢出工作。

答案 1 :(得分:0)

尝试为此添加Div的高度;

height:100%
相关问题