HTML - 隐藏一个iframe [英] HTML - Hide an iframe

查看:113
本文介绍了HTML - 隐藏一个iframe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何隐藏iframe,但仍然加载?等等。用于播放YouTube歌曲。

 < iframe src =https://www.youtube.com/embed/ X18mUlDddCc?autoplay = 1style =display:none;>< / iframe> 

这会隐藏iframe,但它似乎并未加载iframe。 (Song is not playing。)



感谢

解决方案

使用宽度0,高度0和边界0



所以更新的代码将会是!

 < iframe src =https://www.youtube.com/embed/X18mUlDddCc?autoplay=1style = width:0; height:0; border:0; border:none;>< / iframe> 

新增:

style =width:0; height:0; border:0; border:none



它会隐藏它,让媒体在后台播放,并且它也会崩溃它!

b

http://jsfiddle.net/0g51po9t/1/ p>

How do I hide an iframe, but still load it? Etc. For playing a youtube song.

<iframe src="https://www.youtube.com/embed/X18mUlDddCc?autoplay=1" style="display: none;"></iframe>

This will hide the iframe, however it dosen't seems to load the iframe. (Song is not playing.)

Thanks

解决方案

Use can use width 0 , height 0 and border 0

So updated code will be!

<iframe src="https://www.youtube.com/embed/X18mUlDddCc?autoplay=1" style="width:0;height:0;border:0; border:none;"></iframe>

Added:

style="width:0; height:0; border:0; border:none"

It will hide it, make media to play in background and it will also collapse it space!

Updated Fiddle

http://jsfiddle.net/0g51po9t/1/

这篇关于HTML - 隐藏一个iframe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆