Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/69.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/69.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
Jquery 响应全屏幕背景图像,将显示所有内容_Jquery_Html_Css - Fatal编程技术网

Jquery 响应全屏幕背景图像,将显示所有内容

Jquery 响应全屏幕背景图像,将显示所有内容,jquery,html,css,Jquery,Html,Css,我有这个问题: 我试图使图像响应的方式,如果我重新大小的屏幕上仍然显示所有的图像,但在这个演示剑和标志,甚至是时钟的一部分被隐藏,有没有任何方法来解决这个问题 HTML 我注意到你们的图像边缘有相同的颜色,所以你们可以使用下面的技巧 body {background:#525256 url("http://i.imgur.com/rZBejVz.png ") no-repeat center bottom fixed; background-size: contain;} 这里使用一种颜色作为

我有这个问题: 我试图使图像响应的方式,如果我重新大小的屏幕上仍然显示所有的图像,但在这个演示剑和标志,甚至是时钟的一部分被隐藏,有没有任何方法来解决这个问题

HTML


我注意到你们的图像边缘有相同的颜色,所以你们可以使用下面的技巧

body {background:#525256 url("http://i.imgur.com/rZBejVz.png ") no-repeat center bottom fixed; background-size: contain;}
这里使用一种颜色作为背景&使用background size:contain;强制使图像适合屏幕;。这样就产生了图像覆盖整个页面的效果

注意:为了让这个技巧发挥作用,请再次确认图像的边缘具有相同的颜色


请参见此处的演示:

在JSFIDDLE中看不到任何内容请检查我的编辑这是一个很好的技巧,尽管我不能在我的案例中使用它,因为我希望徽标和剑位于屏幕的左、右角screen@Sora,但它们位于左右角!你的意思是左下角和右下角吗?@Sora只需将背景位置更改为“中底”谢谢你的回答,因为我发现很难得到完美的结果——调整窗口大小时,鸟看起来很小,但我想我只能做到这一点。谢谢你的帮助:D
  body{
  background: url('http://i.imgur.com/rZBejVz.png ') no-repeat 50% 80% fixed; 
   background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  -webkit-background-size: cover;
   }
body {background:#525256 url("http://i.imgur.com/rZBejVz.png ") no-repeat center bottom fixed; background-size: contain;}