/* 如果设备像素大于等于2,则用2倍图 */
@media screen and (-webkit-min-device-pixel-ratio: 2), screen and (min--moz-device-pixel-ratio: 2) {
  .img {
    background-image: url(../images/arrow@2x.png);
    background-size: 30px 30px;
    width: 30px;
    height: 30px;
    background-repeat: no-repeat;
  }
}
/* 如果设备像素大于等于3,则用3倍图 */
@media screen and (-webkit-min-device-pixel-ratio: 3), screen and (min--moz-device-pixel-ratio: 3) {
  .img {
    background-image: url(../images/arrow@3x.png);
    background-size: 30px 30px;
    width: 30px;
    height: 30px;
    background-repeat: no-repeat;
  }
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-21
  • 2022-01-01
  • 2021-11-21
  • 2022-12-23
  • 2021-09-20
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-01
  • 2021-12-10
  • 2021-12-21
相关资源
相似解决方案