gpt4 book ai didi

html - Iframe 没有控件工作,视频不播放

转载 作者:太空宇宙 更新时间:2023-11-04 05:39:03 48 4
gpt4 key购买 nike

我只是复制并粘贴了 youtube 给我的 iframe 标签(我的 friend 正在使用相同的视频并且他的工作正常)并且它就像只是视频的屏幕截图,没有任何控件可以工作并且视频可以不播放,如果我只使用视频标签也会发生这种情况,但后来我决定无论如何我宁愿使用它。我已经在 chrome、edge 和 firefox 本地的括号实时编辑器中尝试过它,并将它托管在我的实际网站上:http://lucasjohnson.tech (不要介意它们现在只是占位符的图像)。这是代码:

a {
text-decoration: none;
color: white;
}

body{
margin: 0px;
background-image: url(bg.jpg);

}

/*Header*/


#header h1{
margin: 0;
padding: 0;
color: white;
padding-right: 20px;
}
#header{
margin-left: 13.5%;

background-color: #34486b;
text-align: right;
width: 86.5%;
height: 74px;
padding-top:34px;
font-family: "roboto", sans-serif;
position: fixed;

}





/*Nav*/
#logo {
width:13.5%;
height: 108px;
position: fixed

}



nav {
margin-top: 108px;
width: 13.5%;
float: left;
font-family: "roboto", sans-serif;
background-color: #111934 ;
height: 100vh;
position: fixed;
}

nav li {
list-style: none;
}




/*Body*/

#body{
padding-top: 200px;
position: relative;
margin-left: 13.5%;
z-index: -1;
}
#body img{
margin-left: auto;
margin-right: auto;
display:block;
background-color: transparent;


}





#body h1{
text-align: center;
font-family: "roboto", sans-serif;
}

#body h2{

text-align: center;
font-family: "roboto", sans-serif;

}

#body h3{
text-align: center;
font-family: "roboto", sans-serif;

}






/*Adobe*/

#adobeLogo{
height: 180px;

}

#photoshop{
height: 400px;



}

#psHeader{
margin-top: 100px;
margin-bottom: 0px;

}

#before{
margin-top: 0px;
margin-bottom: 5px;
display: inline-block;
margin-left: 34%;

}

#after{
margin-top: 0px;
margin-bottom: 5px;
display: inline-block;
float: right;
margin-right: 34%;

}


.adobeImg {
visibility: hidden;
margin-bottom: 100px;
}

.fadeIn {
-webkit-animation: animat_show 0.8s;
animation: animat_show 0.8s;
visibility: visible !important;
}

@-webkit-keyframes animat_show{
0%{opacity:0}
100%{opacity:1}
}
iframe{

margin-left:13.5%;
margin-right:auto;
margin-top: 0px;


}

#head {
margin-top: 10%;
margin-bottom: 40%;
}



#arrow{
height: 20px;
margin-top: 25%
}
<!DOCTYPE html>

<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<link href="https://fonts.googleapis.com/css?family=Roboto&display=swap" rel="stylesheet">


</head>

<body>

<img id="logo" src="logo.png">


<nav>

<li>

<ul><a href="index.html">Home &#9679;</a></ul>
<ul><a href="adobe.html">Adobe</a></ul>
<ul><a href="cert.html">Certifications</a></ul>
<ul><a href="hw.html">Hardware</a></ul>
<ul><a href="office.html">Office</a></ul>
<ul><a href="personal.html">Personal</a></ul>
<ul><a href="programming.html">Programming</a></ul>
<ul><a href="contact.html">Contact</a></ul>
</li>

</nav>
<div id = "header">
<h1>
Lucas Johnson Port-a-fortress
</h1>
</div>

<div id = "body">

<img src = "lucas%20scott%20johnson%20living%20at%2024%20brookfield%20drive%20northfield%20drive%20profile%20picture.png">

<h1>Lucas Johnson</h1>
<h3>Programmer and IT Proffesional</h3>
<iframe width="560" height="315" src="https://www.youtube.com/embed/uRvTDuMEfKU" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>

</body>

</html>

如果您需要更多信息,请告诉我,谢谢。

最佳答案

问题是你分配给了父元素#body z-index: -1,这使得元素(和所有子元素)不可点击,所以just改变这个

#body{
padding-top: 200px;
position: relative;
margin-left: 13.5%;
z-index: -1;
}

为此

#body{
padding-top: 200px;
position: relative;
margin-left: 13.5%;
}

关于html - Iframe 没有控件工作,视频不播放,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59361068/

48 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com