• 效果

1

  • 方法

①打开bilibili的视频,复制嵌入代码添加到文章.
②然后给iframe这个标签添加class="iframe_video" iframe_video这个类名.

<iframe class="iframe_video" src="//player.bilibili.com/player.html?aid=58238094&cid=101596459&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"> </iframe>
/*哔哩哔哩视频挂载*/
.iframe_bilibili_video {
    position: relative;
    width: 100%;
}

@media only screen and (max-width: 767px) {
    .iframe_bilibili_video {
        height: 15em;
    }
}

@media only screen and (min-width: 768px) and (max-width: 991px) {
    .iframe_bilibili_video {
        height: 20em;
    }
}

@media only screen and (min-width: 992px) and (max-width: 1199px) {
    .iframe_bilibili_video {
        height: 30em;
    }
}

@media only screen and (min-width: 1200px) {
    .iframe_bilibili_video {
        height: 40em;
    }
}

.iframe_cross {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 75%
}

.iframe_cross iframe {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0
}

此文章转载 Phenxs | 梦旅奈 原文链接:https://www.phenxso.com/archives/87.html

Last modification:March 24th, 2020 at 11:22 am
如果觉得我的文章对你有用,请随意赞赏