前言
直接套用平台给的代码,视频在Typecho博客会有溢出的情况,所有先套用div套一个框框再插入视频或网页会稳妥一点。
↓以下是演示:
B站视频
!!!
<div style="padding-bottom: 80%;width: 100%;position: relative;">
<iframe src="地址" frameborder="0" style="position: absolute;width: 100%;height: 100%;">
</iframe>
</div>
!!!
YouTube
我的网盘(网页)
!!!
<div style="padding-bottom: 82%;width: 100%;position: relative;">
<iframe src="地址" frameborder="0" style="position: absolute;width: 100%;height: 100%;">
</iframe>
</div>
!!!
代码参照上面。
非平台视频,直连请使用下列代码更方便。
!!!
<video width="100%" height="auto" controls="controls" preload="meta" src="直连">
</video>
!!!
Ps: preload 元素
- auto - 当页面加载后载入整个音频
- meta - 当页面加载后只载入元数据
- none - 当页面加载后不载入音频
总结一下
Typecho编辑器还是很好用的只是我没发掘到它潜能罢了。