博客进阶——在网页插入B站视频

本文最后更新时间:2022年3月30日 上午

写在前面

  • 今天本来在研究代码块样式美化,后来逛到了B站,就想能不能把B站视频放到博客里呢?在网上搜索研究后成功实现,现将方法分享给各位。

  • 本文仅作为代码记录,故不解释代码。

具体方法

获取嵌入代码

按照如图方式,获取嵌入代码

获取嵌入代码

代码

直接在post的md文件中加入:

1
2
3
4
5
6
7
8
9
10
<div style="position:relative; padding-bottom:75%; width:100%; height:0">
<iframe src="//player.bilibili.com/player.html?aid=204972683&bvid=BV19h411D7wP&cid=319176732&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"
style="position:absolute; height: 100%; width: 100%;"></iframe>
</div>
</iframe>
<!--
将行2的连接换为B站视频嵌入代码
并删去嵌入代码结尾的'</iframe>'
-->


本文作者:Zhao Guihang/KHLFYY

版权声明:本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!