企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
[TOC] # 响应式+固定宽高比例 使用 `padding-top/padding-bottom` 来代替 `height`属性了.比如你想要让元素的按在 4:3 的比例显示, `width` 设置成了30%,那么 `padding-top/padding-bottom` 只需要设置成为 40%就可以了.同时把 `height` 设为0: ```css .img-3-4 { margin: 10px; padding-bottom: 30%; width: 40%; height: 0; background-color: #dbe0e4; } ``` ## Refs 来源:https://www.jianshu.com/p/56a3adebdb01