How to get IE 10 to show scrollbars on iframe

你离开我真会死。 提交于 2020-01-05 10:29:22

问题


Since time immemorial, if you write:

<iframe scrolling="yes"></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.

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!

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.


回答1:


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

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; }



来源:https://stackoverflow.com/questions/16429894/how-to-get-ie-10-to-show-scrollbars-on-iframe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!