fe-notes icon indicating copy to clipboard operation
fe-notes copied to clipboard

css 自适应正方形实现

Open Inchill opened this issue 3 years ago • 0 comments

实现方式有 3 种:

  1. 父元素设置宽度,子元素撑开,然后设置 padding-bottom 等属性撑开,没有高度的情况下以宽度百分比计算;
  2. 通过 js 控制;
  3. 使用 aspect-ratio 属性:aspect-ratio: 1 / 1;

Inchill avatar Aug 12 '22 02:08 Inchill