我做了一个<iframe>
我网站中的代码(滚动设置为是)。在电脑的浏览器中浏览网站时,滚动条是可见的,但在手机浏览器(android,我没有 checkin 其他浏览器)上,滚动条是不可见的。
我想知道是否有任何方法可以让移动查看器知道该部分(由 iframe 组成)可以滚动?为此,我不想在我的网站中添加文本行。
谢谢
最佳答案
尝试将 iframe
包装在一个 div 中并添加以下样式:
片段
/* The last 2 styles are important, and the rest varies */
.scroller {
position: fixed;
right: 0;
bottom: 0;
left: 0;
top: 0;
-webkit-overflow-scrolling: touch;
overflow-y: scroll;
}
/* The style for iframe varies */
.scroller iframe {
height: 100%;
width: 100%;
}
<div class="scroller">
<iframe src="//example.com" scrolling="yes"></iframe>
</div>
关于html - 关于 <iframe> 中的滚动条,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35799875/