Loading... ## 一、实例 <iframe class="iframe_video" src="//player.bilibili.com/player.html?aid=570597681&bvid=BV1rz4y1Y7ej&cid=1114473192&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"> </iframe> ## 二、后台外观 在`开发者设置`中`自定义 CSS`里添加下面内容 ![CSS](https://www4.iceyer.cn:444/usr/uploads/2023/05/2553759557.png) ``` /*视频挂载*/ .iframe_video { position: relative; width: 100%; } @media only screen and (max-width: 767px) { .iframe_video { height: 15em; } } @media only screen and (min-width: 768px) and (max-width: 991px) { .iframe_video { height: 20em; } } @media only screen and (min-width: 992px) and (max-width: 1199px) { .iframe_video { height: 30em; } } @media only screen and (min-width: 1200px) { .iframe_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 } ``` ## 三、B站复制嵌入代码 ![嵌入代码](https://www4.iceyer.cn:444/usr/uploads/2023/05/693099035.png) 在复制的代码加入`class="iframe_video"` ``` <iframe class="iframe_video" src="//player.bilibili.com/player.html?aid=570597681&bvid=BV1rz4y1Y7ej&cid=1114473192&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"> </iframe> ``` ## 四、最终效果 ![B站视频](https://www4.iceyer.cn:444/usr/uploads/2023/05/90639575.png) Last modification:May 1, 2023 © Allow specification reprint Support Appreciate the author AliPayWeChat Like 1 喜欢我的文章吗? 别忘了点赞或赞赏,让我知道创作的路上有你陪伴。
One comment
不错不错,我喜欢看 https://www.ea55.com/