【问题标题】:Why is my some CSS formatting in a linked style sheet in not applied?为什么我的链接样式表中的某些 CSS 格式未应用?
【发布时间】:2020-07-12 07:10:30
【问题描述】:

我正在尝试使用 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">

【问题讨论】:

  • 这看起来你需要 JS 来触发 youtube 视频,因为

标签: html css formatting html5-video


【解决方案1】:

.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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-09-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-06
    相关资源
    最近更新 更多