html播放youtube

嵌入YouTube视频

iframe代码

<iframe width="100%" style="min-height: 260px;position: absolute;top: 0;bottom: 0;margin: auto 0;" src="https://www.youtube.com/embed/FskRmY22jXqbY" 
frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen>
</iframe>
这是一个嵌入YouTube视频的iframe代码。通过此代码,可以在网页上直接播放指定的YouTube视频。iframe的宽度设置为100%,而高度通过style属性进行调整,确保视频在页面中垂直居中显示。

posted on 2022-05-07 02:59  完美前端  阅读(227)  评论(0)    收藏  举报

导航