export const aspectRatio = (width, height) => {
height: 0,
overflow: 'hidden',
paddingBottom: `${(height / width) * 100}%`,
}
padding-bottom 值为百分比时,百分比与其所在元素的父元素的宽度相关。
博客园 © 2004-2026 浙公网安备 33010602011771号 浙ICP备2021040463号-3