【发布时间】:2011-08-30 04:07:18
【问题描述】:
我使用 jQuery 并淡入 divs。在所有浏览器上都运行良好,但 IE8(我怀疑其他 IE 版本也是如此)将切断divs,当它们的不透明度设置为filter: alpha(opacity=100) 时溢出外部div。如果您将以下内容复制并粘贴到文件中并使用 IE8 加载该文件,您会看到蓝色方块被切断,因为它溢出了其外部 div。
<html>
<head>
<style>
.outer {
filter: alpha(opacity=100);
position: absolute;
top: 0;
left: 0;
width: 200px;
height: 150px;
border: 2px solid #f00;
background-color: #700;
}
.inner {
position: absolute;
top: 100px;
left: 50px;
width: 100px;
height: 100px;
border: 2px solid #00f;
background-color: #007;
}
</style>
</head>
<body>
<div class="outer">
<div class="inner"></div>
</div>
</body>
我怎样才能让它在允许内部 div 溢出的情况下工作(是的,我已经尝试过 overflow: visible)并且我可以使用 jQuery 的动画机制来实现不透明度?
【问题讨论】:
-
我刚用IE8试了你的代码,它确实溢出了......这可能是由于你的jquery代码,你能检查一下吗?
-
我从 IE8 加载的 .html 文件中复制并粘贴了该代码...您是否打开了兼容模式?
标签: html css internet-explorer internet-explorer-8 opacity