Chrome和Safari中的背景被推下来了

时间:2022-06-15 01:28:52

I used "320andup" in order to make my first real responsive website. I managed to have a perfect adaptive environment except only one thing. The background image in Chrome and Safari is pushed down 18px. I can't explain why. Only thing I know is that when i add in the body tag "background-attachment: fixed;" the problem is solved but when I scroll I get an ugly experience that I don't want to have. I also tried this

我使用“320andup”来制作我的第一个真正的响应式网站。除了一件事,我设法有一个完美的自适应环境。 Chrome和Safari中的背景图片被压缩了18px。我无法解释原因。我唯一知道的是当我在body标签中添加“background-attachment:fixed;”问题解决了但是当我滚动时,我得到了一个我不想拥有的丑陋体验。我也尝试过这个

@media screen and (-webkit-min-device-pixel-ratio:0) { 
    body {
    background-image: url(../img/chrome-safari-img.gif);
    }
}

with IE to completely break.

用IE彻底打破。

Firefox, Opera and IE8 are ok. Only problem is Chrome and Safari.

Firefox,Opera和IE8都可以。唯一的问题是Chrome和Safari。

You can see exactly whats the problem and investigate the code in my localhost website -> http://www.demo.lollypop.gr/ffloor

你可以看到问题究竟是什么,并调查我的localhost网站上的代码 - > http://www.demo.lollypop.gr/ffloor

I would like to avoid detecting chrome with PHP.

我想避免用PHP检测chrome。

1 个解决方案

#1


0  

Just add position:absolute; in your body tag.

只需添加位置:绝对;在你的身体标签。

#1


0  

Just add position:absolute; in your body tag.

只需添加位置:绝对;在你的身体标签。