如何使IE 10在iframe上显示滚动条 [英] How to get IE 10 to show scrollbars on iframe

查看:306
本文介绍了如何使IE 10在iframe上显示滚动条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自远古以来,如果您写:

Since time immemorial, if you write:

<iframe scrolling="yes"></iframe>

然后,无论iframe的内容如何,​​都会显示滚动条.如果像我一样,您经常使用iframe来显示表格数据-表格标题位于iframe外部,则务必知道滚动条将始终出现,因此在制作表格标题时可以考虑滚动条的宽度与数据中的列对齐.

Then, regardless of the content of the iframe, scroll bars are shown. If, like me, you use iframes a lot to display tabular data - with the table header outside the iframe, it is important to know that the scrollbars will always appear, so you can allow for the width of the scrollbar when making the table headings line up with the columns in the data.

那么,要使IE 10在设置了scrolling ="yes"的iframe上显示滚动条,您需要做什么?如果内容不超过iframe的大小-IE 10则不会显示滚动条!

So, what do you have to do to get IE 10 to display scroll bars on an iframe with scrolling="yes" set? If the content does not exceed the size of the iframe - IE 10 DOES NOT SHOW Scrollbars!

这是一个小提琴.滚动条未显示的示例在Firefox中查看并显示滚动条.在IE 9中查看它,并显示滚动条.在IE 10中查看它,但没有.

Here's a fiddle.Example of scrollbars not showing View it in Firefox and the scrollbars show. View it in IE 9 and the scroll bars show. View it in IE 10 and they don't.

推荐答案

请注意,WebKit浏览器也不显示滚动条.

Note that WebKit browsers also don't show scroll bars.

如果设置了溢出:滚动;移至将在iframe中使用的文档的根(HTML)元素,它将按预期显示滚动条.

If you set overflow: scroll; to the root (HTML) element of the document that will be used in the iframe, it will show the scroll bars as expected.

   html { overflow: scroll; }

这篇关于如何使IE 10在iframe上显示滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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