iframe未显示在页面上

时间:2019-12-14 01:33:11

标签: html

为什么我的iframe没有出现在: http://orcaaccounting.com/helloFriend.html

这是我的代码,

<p style="text-align:centre;"> 
<iframe width="560" height="315" src="https://www.youtube.com/watch?v=riFyKUyGb4k" frameborder="0" allowfullscreen></iframe> </p>

谢谢,我确定我缺少一些小东西,但这是我的瓶颈。

2 个答案:

答案 0 :(得分:1)

好像您缺少包含allow和网址的encrypted-media部分的embed属性。这应该工作。您应该从YouTube视频本身复制“嵌入”链接,这是获取iframe的适当方法。

<iframe width="560" height="315" src="https://www.youtube.com/embed/riFyKUyGb4k" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

答案 1 :(得分:1)

src错误,请添加嵌入而不是观看。

<iframe width="560" height="315" src="https://www.youtube.com/embed/riFyKUyGb4k" frameborder="0" allowfullscreen></iframe>