Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/85.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 试图在网页中显示YouTube视频_Html_Youtube - Fatal编程技术网

Html 试图在网页中显示YouTube视频

Html 试图在网页中显示YouTube视频,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_fN8LXc

我试图在网页上显示一段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>


格拉纳达高中1986年毕业班

试试这段代码。这是Youtube在您单击共享然后嵌入时提供的:


希望它有帮助

在iframe中显示时,您需要使用“嵌入”url,如视频的“共享”部分所示。
<iframe width="560" height="315" src="https://www.youtube.com/embed/l_fN8LXco2A" frameborder="0" allowfullscreen></iframe>