苹果IOS系统下iframe宽度超出设备宽度解决方法

iframe嵌套常用于代码展示网站中或网站的广告展示中,我们常用的格式如下:

<iframe src="https://www.xuexiareas.com/" width="100%" height="4000"></iframe>

给iframe设定100%的宽度,高度固定像素,便能 正常展示!但实际应用中却发现在PC端、android上该改方法均能正常展示,但在IOS系统中iframe的宽度却超过了设备正常宽度,如图下图,那么关于该问题我们要如何解决呢?

关键代码:

scrolling="no" 
style=" overflow: scroll; -webkit-overflow-scrolling: touch;min-width: 100%;*width:100%;width:1px;height:4000px"

解决代码:

<iframe id="sydedsid" scrolling="no" style=" overflow: scroll;
-webkit-overflow-scrolling: touch;
min-width: 100%;
*width:100%;
width:1px;height:4000px" frameborder="0" src="https://www.xuexiareas.com/"></iframe>

对iframe设置以上样式便能使iframe在IOS系统中正常展示!


六月初字帖坊小程序 你想要的字帖模板及工具,这里都有!