Html 如何在iframe中全屏播放YouTube视频?

Html 如何在iframe中全屏播放YouTube视频?,html,iframe,youtube,youtube-iframe-api,Html,Iframe,Youtube,Youtube Iframe Api,当我在iframe中嵌入YouTube视频时,它工作正常,但在全模式下,视频在整个屏幕上不可见 <iframe src="https://www.youtube-nocookie.com/embed/rGmF2CaDiBg?rel=0" frameborder="0" allow="autoplay; encrypted-media" class="iframe" id="Overlayvideo" **allowfullscreen="true"**&

当我在iframe中嵌入YouTube视频时,它工作正常,但在全模式下,视频在整个屏幕上不可见

<iframe src="https://www.youtube-nocookie.com/embed/rGmF2CaDiBg?rel=0" 
        frameborder="0" allow="autoplay; encrypted-media" class="iframe" 
        id="Overlayvideo" **allowfullscreen="true"**>
</iframe>

在css中使用以下内容
#Overlayvideo{宽度:100%;}

HTML


CSS

iframe{
位置:绝对位置;
排名:0;
左:0;
宽度:100%;
身高:100%;
}