WordPress 插入Bilibili视频

最后更新于:2022-03-30

此文章最后编辑于 8 个月前,部分信息可能已经过时,请自行斟酌确认。
文章转载自bianhb博客

比如以下由Bilibili提供的代码:

<iframe src="//player.bilibili.com/player.html?aid=755757862&bvid=BV1Lr4y1F7fW&cid=271387869&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"> </iframe>

可以对长宽进行设置:

<iframe src="//player.bilibili.com/player.html?aid=28517524&cid=49353923&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true" width="700" height="500"> </iframe>

然后插入到html编辑器中,并且将视频居中,就成如下的内容了:

<p align="center"><iframe src="//player.bilibili.com/player.html?aid=930691322&bvid=BV19K4y197hB&cid=342471775&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true" width="700" height="500"> </iframe>

另一种方法(可自适应设备大小):

<div style="position: relative; padding: 30% 45%;">
<iframe style="position: absolute; width: 100%; height: 100%; left: 0; top: 0;src="src="//player.bilibili.com/player.html?aid=930691322&amp;bvid=BV19K4y197hB&amp;cid=342471775&amp;page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true" ></iframe>
</div>

标签: 还没有标签哦

评论已关闭。 了解详情