美文网首页CSSvue系列uni
图片等比设置宽高

图片等比设置宽高

作者: litielongxx | 来源:发表于2022-12-30 17:47 被阅读0次

图片设置等比,除去父级100%,子元素padding-bottom外也可以直接css属性。
css属性:aspect-ratio:

aspect-ratio: 4  // 宽高比4:1
aspect-ratio: 2 / 1; 宽高比2:1

相关文章

网友评论

    本文标题:图片等比设置宽高

    本文链接:https://www.haomeiwen.com/subject/wrbtcdtx.html