ios系统和某些移动端background-attachment:fixed不兼容性,没有任何效果,但可以hack一下就可以了,代码如下:

ps:想在哪个标签加背景,可以在它class后:before.

body:before {
  content: ' ';
  position: fixed;
  z-index: -1;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: url(path/to/image) center 0 no-repeat;
  background-size: cover;
}

相关文章:

  • 2022-12-23
  • 2021-12-06
  • 2022-12-23
  • 2021-12-22
  • 2022-02-18
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-06
  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
  • 2021-10-19
  • 2022-03-02
相关资源
相似解决方案