This question already has an answer here:
Using percentage values with background-position on a linear gradient
                                
                                    (1个答案)
                                
                        
                                上个月关闭。
            
                    
有没有办法以百分比显示正确的background image?以像素为单位的值可以正常工作,但不能以百分比为单位!
JSfiddle

html:<div></div>

CSS:

div {
  position: absolute; top: 0; left: 0; bottom: 0; right: 0;
  background-image: url('http://www.pngall.com/wp-content/uploads/2016/07/Arrow-PNG-Pic.png');
  background-size: auto 90%;
  background-position: right 20% center;
  background-repeat: no-repeat;
}

最佳答案

您的背景太大。大于100%。那给您不可预测的结果!在这里,您可以看到具有较小png大小的代码,按预期工作!

div {
  position: absolute; top: 0; left: 0; bottom: 0; right: 0;
  background-image: url('http://www.pngall.com/wp-content/uploads/2016/07/Arrow-PNG-Pic.png');
  background-size: auto 10%;
  background-position: right 10% center;
  background-repeat: no-repeat;
}


https://jsfiddle.net/zn2ujy4b/

08-18 20:45