我设计了一个 html 页面,但我的 href 和我的 youtube iframe 不允许我点击



我有一个网页,只有一个CSS文件和一个html文件,我不知道为什么我不能点击这个YouTube嵌入链接或点击"点击这里"a.href

https://codepen.io/deuelJordan/pen/XWgQGJK

<iframe width="750" height="422" src="https://www.youtube.com/embed/rt-2cxAiPJk"
title="YouTube video player" frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen>
</iframe>

thank a bunch

看看这里的z-index文档:https://developer.mozilla.org/en-US/docs/Web/CSS/z-index

你应该改变

z-index: -1; 

z-index: 1;

这将使您希望其他人访问的代码链接工作。

如果还有什么我能帮忙的,我会很乐意帮忙的!:)

问题出在CSS部分。如果你改变

z-index: -1;

z-index: 1;

你的页面会正常工作

按如下注释或删除z-index:

.black-rect {
background-color: rgb(0, 0, 0);
border-radius: 10px;
/* z-index: -1; */
width: 1280px;
height: 720px;
position: relative;
left: 125px;
}

你可以检查更新演示CodePen: https://codepen.io/tibichi/pen/NWgmVOE

最新更新