为什么在IE上滚动时固定的背景图像会移动? [英] Why does a fixed background-image move when scrolling on IE?

查看:149
本文介绍了为什么在IE上滚动时固定的背景图像会移动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正试图修正background-image.

正如您在我的博客中看到的那样,background-image在IE 11上滚动时正在移动.

As you see in my blog, the background-image is moving when scrolling on IE 11.

我该如何解决?

这是我的CSS:

background-image: url("./images/cover.jpg");
background-repeat: no-repeat;
background-position: center center;
background-attachment: fixed;
background-size: cover;

推荐答案

这是Internet Explorer中具有固定背景图片的已知错误.我们最近做了一些工作来改善此行为,并已将更新发布到Windows 10上的Internet Explorer预览版本中.您现在可以从Mac OS X或Windows的

This is a known bug with fixed background images in Internet Explorer. We recently did some work to improve this behavior and have shipped updates to our preview build of Internet Explorer on Windows 10. You can test the changes today from Mac OS X or Windows on http://remote.modern.ie.

以下是之前和之后的IE 11和IE Remote Preview.请注意,使用鼠标滚轮滚动不再像固定的Internet Explorer 11那样导致固定的背景图像跳动(或抖动).

Below is the before and after, IE 11 and IE Remote Preview. Notice how scrolling with the mouse-wheel no longer causes the fixed background image to jump (or jitter) as it did in Internet Explorer 11.

这篇关于为什么在IE上滚动时固定的背景图像会移动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆