2013-04-06 80 views
0

Hy there 我真的不知道什么是错的,我没有明白。 我使用多张图片为背景的身体 是这样的:背景位置仅适用于像素?

body 
    { 
    background: url('bison.png'),url('ryu.png'); 
    background-repeat:no-repeat,no-repeat; 
    background-position:left bottom,right bottom; 
    background-size:200px,200px; 
    } 

但不是显示在底部的图像,它出现在顶部? 这里有一些画面:

http://i.imgur.com/PHC1kuK.png

现在,我使用过%。同样的问题,比如说20%50%,h线20%和v 50%,它应该出现在屏幕中间左侧的某个位置,但它不会,相反,1/4的img是可见的,另外3/4是隐藏在顶部浏览器部分的某个地方。而不是把它从顶线推下50%,它确实推高了3%? 唯一可行的是像素和负数%,即-50%,但为什么? 不能使用像素,因为我希望CSS能够响应各种屏幕分辨率。 感谢

回答

0

指定一些高度:

body { 
    height: 500px; 
    background: url('bison.png'),url('ryu.png'); 
    background-repeat:no-repeat; 
    background-position:left bottom,right bottom; 

}