iframe

iframe 标签用于在网页里面嵌入其他网页。

1
2
3
4
<iframe src="https://www.example.com/"
width="100%" height="500" frameborder="0"
allowfullscreen sandbox>
</iframe>

以上代码意思就是在网页中嵌入一个示例站点(https://www.example.com/)
宽度自适应100% ,高度为500像素。 边框宽度为0
效果如下↓

1
2
3
4
5
6
<div style="position: relative; padding: 30% 45%;">
<iframe style="position: absolute; width: 100%; height: 100%; left: 0; top: 0;"
src="https://player.bilibili.com/player.html?aid=692332871&bvid=BV1d24y1Y79G&cid=950939214&p=1&autoplay=0"
scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true" danmaku="0">
</iframe>
</div>

自动播放需要加在链接的后方使用 “&” 连接

https ://xxxxxx.xxx&autoplay=0

作用 意义
autoplay 自动播放 0/1
danmaku 弹幕 0/1
muted 静音 0/1
hasMuteButton 隐藏静音按钮 0/1
hideCoverInfo 播放量,弹幕等 0/1
hideDanmakuButton 隐藏弹幕按钮 0/1
noFullScreenButton 隐藏全屏按钮 0/1
fjw 记忆播放 0/1
t 开始时间/秒
highQuality 高清 0/1