html - 我正在尝试将youtube视频嵌入我的网页中,但根本不显示

标签 html css video youtube embed

我是HTML编程的新手,所以请在这里忍受。为什么嵌入式管视频不显示?我在这里想念什么吗?我还包括CSS文件,以备不时之需。

<!DOCTYPE html>
<html>
<head>
    <link type="text/css" rel="stylesheet" href="stylesheet.css"/>
    <title>Mysteries</title>
    <meta charset="utf-8">
</head>

<html>
<body class="index">

<div id="header_box">
    <h4 class="logo">MYSTERIES<span class="orange2">/</span>PARANORMAL</h4>
    <a  href="index2.html" id="content_link">CONTENT</a>
</div>


<div id="footer">
    <h4>&#60;OKLAH/WEBSOFT&#62; 2015 All Rights Reserved.</h4>
<div>

<iframe width="560" height="315" src="https://www.youtube.com/embed  /Gas8f7dJfWc?rel=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe>

</body>
</html>


Here is the CSS Code for the webpage, please keep in mind im new  to all this, so i might have some css errors in there

#header_box {
z-index: 1;
position: fixed;
background-color: rgba(255,255,255,0.25);
border: 1px solid #FFF;
width: 100%;
height: 22px;
left: -2px;
padding: 1em 1.5em;
padding-top: 1em;
padding-right: 1.5em;
padding-bottom: 1em;
padding-left: 1.5em;
top: 0px;

}

.index {
background: #000;
}

.logo {
color: white;
font-family: Verdana;
font-weight: 300px;
float: left;
padding-top: 0px;
margin-top: 0px;
font-size: 16px;


}

}
.orange2 {
color: #FF6600;
}
.orange {
color: #FF6600;
}
.h2 {
color: #FFF;
text-align: center;
padding-top: 10px;
font-family: ISOCT;
letter-spacing: 0.1em;
text-transform: uppercase;
}
img {
float: center;
width: 55px;
height: 50px;
padding-top: 70px;
display: block;
margin: auto;
}

p {
color: #FFF;
text-align: center;
font-family: ISOCT;
font-size: 20px;

}
#paranormal_cont {
color: #FFF;
font-family: Verdana;
float: right;
text-decoration: none;
margin-right: 20px;
}
#paranormal_cont:hover{
border: 1px;
border-style: dotted;
font-weight: bold;
color: #FF6600;
}
#content_link {
color: #FFF;
font-family: Verdana;
float: right;
text-decoration: none;
margin-right: 50px;
}

#content_link:hover {
border: 1px;
border-style: dotted;
font-weight: bold;
color: #FF6600;

}

#footer {

position: fixed;
bottom: 0px;
margin: 0;
padding: 0;
left: 0;
right: 0;
background-color: rgba(255,255,255,0.25);
border: 1px solid #FFF;
width: 100%;
height: 40px;
left: -1px;
}

#footer h4 {
position: relative;
text-align: left;
color: #FFF;
font-family: Verdana;
font-size: 14px;
font-weight: 300px;
margin-left: 10px;
margin-top: 10px;}

最佳答案

问题是您忘了关闭页脚div。这就是为什么您没有看到iframe的原因。

另外,出于完整性考虑,提及它“更改链接,使其没有空格”,尽管您已经排除了它的问题,因为您说过

actually there is no space in the original code, so the link is ok, what else could it be?



为了完整起见,这里有完整的工作代码。
<!DOCTYPE html>
<html>
<head>
    <link type="text/css" rel="stylesheet" href="stylesheet.css"/>
    <title>Mysteries</title>
    <meta charset="utf-8">
</head>

<html>
<body class="index">

<div id="header_box">
    <h4 class="logo">MYSTERIES<span class="orange2">/</span>PARANORMAL</h4>
    <a  href="index2.html" id="content_link">CONTENT</a>
</div>


<div id="footer">
    <h4>&#60;OKLAH/WEBSOFT&#62; 2015 All Rights Reserved.</h4>
</div> <!-- You forgot to close this div -->

<iframe width="560" height="315" src="https://www.youtube.com/embed/Gas8f7dJfWc?rel=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe>

</body>
</html>

关于html - 我正在尝试将youtube视频嵌入我的网页中,但根本不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33422551/

相关文章:

css - 向下滚动时展开 DIV 到页面底部

python - 无法查看Python OpenCV录制的视频

java - 在 Java 中将视频分割成更小的定时片段

使用 Wowza Media Engine 的 Android 流媒体直播相机

javascript - flexslider 单击背景时如何显示我的照片灯箱

c++ - 托管 html/css/js UI 的最轻量级方式?

javascript - 无法获取正确的 key 代码

php - 已访问链接颜色变化

javascript - EasleJS Canvas 不显示指定的 Google 字体

css - 在 Next.js 12 中使用带有 SCSS 的 Bootstrap