Html 保持Iframe的纵横比
我有下面的htmlHtml 保持Iframe的纵横比,html,css,iframe,Html,Css,Iframe,我有下面的html <div class="ex1"> <iframe class="ex2" src="video link"></iframe> </div> 你能不能不简单地调整ex2的宽度和高度?如高度:100%;宽度:56.25% .ex1 { position: absolute; width: 100%; height: 100%; } .ex2 { position: absolute;
<div class="ex1">
<iframe class="ex2" src="video link"></iframe>
</div>
你能不能不简单地调整ex2的宽度和高度?如
高度:100%;宽度:56.25%代码>
.ex1 {
position: absolute;
width: 100%;
height: 100%;
}
.ex2 {
position: absolute;
width: 100%;
height: 100%;
max-width: 1200px;
max-height: 700px;
}