用rpx做单位即可

swiper {
  height: 300rpx;
}

swiper-item image {
  width: 100%;
  height: 100%;
}

  • rpx(responsive pixel): 可以根据屏幕宽度进行自适应。规定屏幕宽为750rpx。如在 iPhone6 上,屏幕宽度为375px,共有750个物理像素,则750rpx = 375px = 750物理像素,1rpx = 0.5px = 1物理像素。

相关文章:

  • 2022-12-23
  • 2021-08-01
  • 2021-07-06
  • 2021-10-23
  • 2022-01-07
  • 2021-10-02
  • 2021-10-28
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-09
  • 2021-09-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案