这里是HTML代码:
<div class="container">
<div class="wrapper">
<iframe src="...."></iframe>
</div>
</div>
包装器的CSS样式如下:
position: relative;
width: 100%;
height: 100%;
height: 0;
padding-bottom: 56.25%;
overflow: hidden;
iframe的CSS样式如下:
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
border: 0;
这个容器有CSS样式:
position: relative;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
justify-content: center;
margin: 0 auto;
top: 50%;
transform: translateY(-50%);
max-width: 1280px;
max-height: 720px;
我正在尝试保护iframe的16:9宽高比,使其在窗口大小调整时保持不变,并将其最大高度保持在100% - 67px(即calc(100% - 67px))。如何同时实现这两个目标?