小智 6
请参阅Sathran的答案:高度等于动态宽度(CSS流体布局)
HTML:
<div class="model-box">
<iframe class="model" src="https://sketchfab.com/models/442c548d94744641ba279ae94b5f45ec/embed" frameborder="0" allowfullscreen=""></iframe>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
.model-box {
position: relative;
width: 100%;
height: 0;
padding-top: 66.6%; /* This is your aspect ratio */ }
.model {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
width: 100%;
height: 100%
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6469 次 |
| 最近记录: |