找到我们想插入的哔哩哔哩视频点击分享按钮然后点击嵌入代码就自动复制到粘贴板了

21057-1

默认是

1
<iframe src="//player.bilibili.com/player.html?isOutside=true&aid=80433022&bvid=BV1GJ411x7h7&cid=137649199&p=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>

但是我们放到hexo后可以看到页面非常难看

21057-2

然后我们可以把html代码中的视频链接提取出来放到下面的代码中

1
2
3
4
{% raw %}
<div style="position: relative; width: 100%; height: 0; padding-bottom: 75%;">
<iframe src="哔哩哔哩视频链接" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true" style="position: absolute; width: 100%; height: 100%; Left: 0; top: 0;" ></iframe></div>
{% endraw %}

然后我们可以看一下效果

21057-3