Hexo文章插入B站视频

B站直接提供了嵌入代码,其实只要直接粘贴进md即可。点击视频分享按钮,选择嵌入代码进行复制

示例:

但是播放窗口很小而且不能全屏


最佳方案:

  • 在[BlogRoot]\source\css\custom.css自定义样式的文件中引入如下代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/*哔哩哔哩视频适配*/
.aspect-ratio {
position: relative;
width: 90%;
height: auto;
padding-bottom: 75%;
margin: 3% auto;
text-align: center;
}
.aspect-ratio iframe {
position: absolute;
width: 100%;
height: 86%;
left: 0;
top: 0;
}
  • 复制插入md文件就行