我正试图在Iframe中显示一个全屏网站,尽管垂直滚动在iOS手机上不起作用(在safari、chrome上测试)。
我正在使用
<style>
iframe {
border: 0;
position:fixed;
top:0;
left:0;
right:0;
bottom:0;
width:100%;
height:100%
-webkit-overflow-scrolling:touch;
overflow:auto;
}
</style>
<div style="-webkit-overflow-scrolling:touch;">
<iframe src="http://www.neti.ee/">
</div>
使用-webkit溢出滚动:触摸;据说可以解决问题,但对我来说不起作用。是什么原因造成的?
-webkit溢出滚动:触摸;对iframe无效。不要使用它,它不是一个标准的css规则。使用
overflow-y:scroll;
使用时滚动开始工作
<style>
iframe {
overflow: scroll !important;
width: 100%;
height: 100%;
border: none;
}
div {
height: 100%;
width: 100%;
position: absolute;
}
body {
margin:0;
}
</style>
<div>
<iframe src="http://www.neti.ee">
</div>