溢出:调整大小时,IE7中的auto会为滚动条留出空间 [英] overflow: auto in IE7 leaves room for the scrollbar when resizing

查看:73
本文介绍了溢出:调整大小时,IE7中的auto会为滚动条留出空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于客户的要求,我将div更改为

Because a customer requested it, I've changed a div to

position: absolute;
top: 5px;
bottom: 5px;
overflow: auto;
min-width: 945px;

基本上可以在所有受支持的浏览器(IE7,IE8,Firefox 3+)中正常运行:它使div垂直填充可用区域,如果不合适,则显示垂直滚动条.请注意,如果没有945px的最小宽度,则滚动条将覆盖部分内容,因为在所有Internet Explorer版本中添加滚动条时,都无法正确调整内容的大小.最小宽度恰好适合,其他浏览器不在乎.

which basically works fine in all supported browsers (IE7, IE8, Firefox 3+): It makes the div fill out the available area vertically, and show a vertical scrollbar if it doesn't fit. Note that without the min-width of 945px, the scrollbar would overlay a part of the content, since the content is not resized properly when the scrollbar is added in all Internet Explorer versions. With the min-width, it happens to fit, and other browsers don't care.

但是,在IE7上,如果显示垂直滚动条,然后垂直扩展浏览器窗口以便不再需要该滚动条,则IE7会删除该滚动条,但在滚动条所在的位置留出空白矩形 em>,即div内容未扩展到以前的滚动条区域.在同一窗口中重新加载页面时,就可以了. IE8在标准模式下没有显示此问题.

However, on IE7, if a vertical scrollbar is displayed and then the browser window is extended vertically so that the scrollbar is no longer needed, IE7 removes the scrollbar, but leaves a blank rectangle where the scrollbar was, i.e. the div content is not extended to the former scrollbar area. When reloading the page in the same window, it's fine. IE8 does not show this problem in standards mode.

我该如何解决?

推荐答案

在我看来,ie7或您的ie7中有一个错误.至于您的代码,虽然有些奇怪,但您希望div水平滚动吗?

it sounds to me like there is a bug in ie7 or your ie7 specifically. as for your code, its fine, although a little odd, do you want the div to horizontally scroll?

这篇关于溢出:调整大小时,IE7中的auto会为滚动条留出空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆