Javascript 背景图像不收缩取决于移动屏幕中的设备

Javascript 背景图像不收缩取决于移动屏幕中的设备,javascript,html,css,responsive-design,Javascript,Html,Css,Responsive Design,我有一个斗争显示的背景图像所需的方式。 在桌面版上,即使我使用最小的分辨率——图像在内部收缩,但当我在手机上尝试时——它也不起作用 padding: 0; margin: 0; width: 100%; height: 100%; background: url("../img/background_photo.png") center fixed; background-repeat:no-repeat; background-position: center center; -webkit-

我有一个斗争显示的背景图像所需的方式。 在桌面版上,即使我使用最小的分辨率——图像在内部收缩,但当我在手机上尝试时——它也不起作用

padding: 0;
margin: 0;
width: 100%;
height: 100%;
background: url("../img/background_photo.png") center fixed;
background-repeat:no-repeat;
background-position: center center;
-webkit-background-size:cover;
-moz-background-size:cover;
-o-background-size:cover;
background-size: cover;
这是背景图像的代码。无论宽度或高度如何,它都会收缩,因此看起来很漂亮,但在手机上,它不起作用

padding: 0;
margin: 0;
width: 100%;
height: 100%;
background: url("../img/background_photo.png") center fixed;
background-repeat:no-repeat;
background-position: center center;
-webkit-background-size:cover;
-moz-background-size:cover;
-o-background-size:cover;
background-size: cover;

我想问题一定是这样,因为我没有在媒体查询中包含代码,但当我添加代码时,它又不起作用了。

可能重复的你不能调整移动设备的大小,可以吗??@AndrewL昨天我在安卓手机上测试了它,它起了作用。我发现有趣的是,有一些东西在安卓手机上工作,但在iPhone上——不要。我会试试你的建议,告诉你它是否有效