CSS HTML覆盖div宽度以使YouTube视频全宽

时间:2018-03-15 22:37:58

标签: html css youtube

如何让这个YouTube视频覆盖父div并以整页宽度播放?

代码是:

div,span,iframe,p{margin:0;padding:0;border:0;vertical-align:baseline;font-size:100%;}
p{margin:7px 0;padding:0;}
::selection{background:#fbf6d6;color:#555555;}
::-moz-selection{background:#fbf6d6;color:#555555;}
.section-boxed{position:relative;margin:0 auto;padding:0 3%;max-width:1200px;}
.page-template-template-full-custom-php .section-boxed{max-width:1200px;}
#content-container .section-boxed{margin:90px auto;}
#content-container .section-full-width .section-boxed{margin:90px auto;}
@media screen and (max-width: 520px){
#content-container .section-full-width .section-boxed,#content-container .section-boxed{margin:30px auto;}
}
#content-container .section-boxed{margin:30px auto;}
::selection{background:#f4f4f4;color:#555555;}
<div class="section-full-width section-light" style="background-color:#d4d4d4;" id="section-3"><div class="section-boxed" style="color:#777777;"><p><iframe width="100%" height="860" src="https://www.youtube.com/embed/fW6pDnoSi94" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen=""></iframe></p>
</div></div>

提前致谢!

0 个答案:

没有答案