html - 尝试在网页上显示YouTube视频

标签 html youtube

我试图在网页上显示YouTube视频,但是出现的是一个带有黑色边框的空白框,该视频应该放在黑色边框上。这是代码。

<html>
<head>
<title>Granada High School Class of 1986 Graduation</title>
</head>
<body>
<iframe width="420" height="315"
src="https://www.youtube.com/watch?v=l_fN8LXco2A?autoplay=0">
</iframe> 
</body>
</html>

最佳答案

试试这个代码。当您单击共享然后嵌入时,这是由Youtube提供的:

enter image description here

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

希望能帮助到你

关于html - 尝试在网页上显示YouTube视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36671322/

相关文章:

javascript - 使用 d3js 的词云

javascript - jQuery :not() with parameter as value not working

android - 使用arrayadapter向 ListView 动态添加项目

javascript - Youtube - onStateChange 处理一个视频而不是另一个

youtube - 阻止来自 YouTube 的 DASH 视频流

jquery - 单击按钮时 twitter bootstrap 导航栏无法正确扩展

html - 如何覆盖 Bootstrap 的默认 css 样式规则

javascript - NodeList 事件不起作用

ASP.NET 4.0 YouTube 视频

php - Youtube API 获取视频查询