Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 手机上的背景图像不正确_Css - Fatal编程技术网

Css 手机上的背景图像不正确

Css 手机上的背景图像不正确,css,Css,我的背景图像在屏幕上 但是继续 太奇怪了,怎么修复 .contact padding: 80px 30px color: #fff background: #151515 url('../src/assets/images/about.jpg') no-repeat fixed left bottom min-height: 100% background-size: cover position: relative 如果没有要测试的代码,我认为问题来自fixed属性:

我的背景图像在屏幕上

但是继续

太奇怪了,怎么修复

.contact
  padding: 80px 30px
  color: #fff
  background: #151515 url('../src/assets/images/about.jpg') no-repeat fixed left bottom
  min-height: 100%
  background-size: cover
  position: relative

如果没有要测试的代码,我认为问题来自
fixed
属性:

如果删除它,它将显示适合视口的图像,并切割无法显示的零件。由于图像比视口大得多,因此使用“固定”时,它将显示适合当前视口的图像部分

因此,请尝试:

background: #151515 url('../src/assets/images/about.jpg') no-repeat left bottom;

手机上的背景图像不正确。您可以选择css背景大小的手机:

background-size: contain;

你可以在手机上玩debbug。将您的手机连接到pc:特别是什么手机?也许是在运行Safari 6?请参阅,注意#2。或者已知问题,“iOS Safari有错误行为,背景大小:封面;+背景附件:固定”;如果您想在桌面上保留固定的背景,可以使用媒体查询