【发布时间】:2022-01-18 21:54:50
【问题描述】:
我需要使块的宽度和高度动态相等。 但它们等于块的高度。
对于我可以写的宽度:
width: 100%;
padding-bottom: 100%;
position: absolute;
left: 0;
top: 0;
块将是方形;
除了身高,我怎么能做到这一点?
有些喜欢:
height: 100%;
padding-right: 100%;
position: absolute;
left: 0;
top: 0;
这样不行
【问题讨论】:
标签: css