html

<div class="autoimg">
    <img src="xxx.jpg" />
</div>

css

.autoimg {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  overflow: hidden;
}
.autoimg img {
    position:absolute;
    top: 0;
    left: 0;
    width: 100%;
}

相关文章:

  • 2022-12-23
  • 2021-12-02
  • 2022-12-23
  • 2021-09-01
  • 2021-12-31
  • 2021-09-26
  • 1970-01-01
猜你喜欢
  • 2022-12-23
  • 2021-07-28
  • 2022-12-23
  • 2021-05-17
  • 2022-01-20
  • 2022-12-23
相关资源
相似解决方案