首页 > 解决方案 > 为什么我的链接样式表中的某些 CSS 格式未应用?

问题描述

我正在尝试使用 CSS 样式表在我的页面中添加一个 Youtube 视频到我的页面,由于某种原因,视频没有出现

.youtube-video iframe,
.youtube-video img,
.youtube-video-2 iframe,
.youtube-video-2 img {
    position: absolute;
    top: 0px;
    left: 12%;
    width: 890px;
    height: 500px;
    cursor: pointer;
}
img {
    vertical-align: middle;
}
<img class=" ls-is-cached lazyloaded" data-src="https://supertasker.pk/images/youtube-video-1-min-new.png" alt="Youtube-vide" video-url="https://www.youtube.com/embed/-luUppOIWHA" src="https://supertasker.pk/images/youtube-video-1-min-new.png">

标签: htmlcssformattinghtml5-video

解决方案


.youtube-video iframe,
.youtube-video img,
.youtube-video-2 iframe,
.youtube-video-2 img {
    position: absolute;
    top: 0px;
    left: 12%;
    width: 890px;
    height: 500px;
    cursor: pointer;
}
img {
    vertical-align: middle;
}
<iframe width="420" height="315" src="https://www.youtube.com/embed/tgbNymZ7vqY"></iframe>

现在将在此处运行,因为它已被此站点阻止。但你可以在这里检查它的工作: https ://www.w3schools.com/html/tryit.asp?filename=tryhtml_youtubeiframe


推荐阅读