css - 位置 :relative item WAS out-of-screen 时的 IE7 滚动条

标签 css internet-explorer-7

IE7 似乎显示滚动条,当一个元素上有 position: relative 用于引起滚动条时(例如,如果您关闭 position: relative 就会显示滚动条)。

<div class="box">
    <div class="inner box"></div>
</div>

.box {
    position : absolute;
    top      : 5px;
    left     : 100px;
    right    : 5px;
    height   : 100px;
    border   : 1px solid #000;
}

.inner {
    right    : auto;
    position : relative;
    width    : 110%;
    left     : -90px;
}

演示:http://jsfiddle.net/VE9ne/1/

想知道是否有人看到过这个问题并且知道如何修复它?

最佳答案

使用负边距代替负边距

...
left:0;
margin-left:-90px; 

关于css - 位置 :relative item WAS out-of-screen 时的 IE7 滚动条,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6550787/

相关文章:

html - 为什么我的列标题不对齐?

CSS 标签边框问题

php - 在 Woocommerce 中使用短代码显示带有动态产品 ID 的自定义按钮

html - CSS 文本不会在居中对齐 div 下向左浮动

javascript - .split 在 IE 7 中不起作用

css - IE 7中不显示CSS按钮背景色

css - 选择每组 sibling 中的最后一个 sibling

CSS3 多个背景在 IE 中导致 404

html - Internet Explorer 7 为我的输入 type=image 添加了一个 3 像素的底部间隙

css - 在宽度为 :100% IE7 的 div 容器中向左浮动和向右浮动