2015-06-22 28 views
0

当我尝试在iPhone设备上的iframe中打开链接时,默认情况下它会将src url的宽度设置为980像素。默认情况下iphone5上的iframe问题将宽度设置为980 px

<iframe 
    width="100%" 
    height="700" 
    frameborder="0" 
    marginheight="0" 
    marginwidth="0" 
    scrolling="yes" 
    src="http://example.com" 
    style="overflow: hidden; margin: 0px;"> 
</iframe> 

回答

0

将你的iFrame包装在一个带有类视频包装的div中。然后把这个在你的CSS:

.videoWrapper { 
position: relative; 
padding-bottom: 56.25%; /* 16:9 */ 
padding-top: 50px; 
height: 0; 
} 
.videoWrapper iframe { 
    position: absolute; 
    top: 0; 
    left: 5%; 
    width: 90%; 
    height: 90%; 
} 

希望帮助!

相关问题