小编yaz*_*azz的帖子

绝对定位元素裁剪,如果位置在其父项IE7之外

你好

我试图定位一个元素,使其略微位于其父项之外.在IE8中它可以工作,但在IE7中,定位元素被剪裁.

这是我的代码HTML:

<div id="parent">
    <div id="child">text</div>
</div>
Run Code Online (Sandbox Code Playgroud)

CSS

#parent {
height: 40px;
width: 400px;
position: relative;
}

#child {
position: absolute;
width: 100px;
height: 60px;
top: 0px;
left: 0px;
}
Run Code Online (Sandbox Code Playgroud)

在IE7中,您将看到子元素的最后20px被剪裁.我怎么解决这个问题?

谢谢

html css internet-explorer-7 internet-explorer-6

5
推荐指数
1
解决办法
4735
查看次数