Why does a fixed background-image move when scrolling on IE?

前端 未结 11 1411
时光取名叫无心
时光取名叫无心 2020-12-29 06:37

I\'m trying to make background-image fixed.

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

How can

11条回答
  •  佛祖请我去吃肉
    2020-12-29 07:17

    For latest edge release use this, as prior answer by twicejr no longer works:

    /*Edge - works to 41.16299.402.0*/
    @supports (-ms-ime-align:auto) 
    {
        html{
            overflow: hidden;
            height: 100%;       
        }
        body{
            overflow: auto;
            height: 100%;
            position: relative;
        }
    }
    
    /*Ie 10/11*/
    @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) 
    {
        html{
            overflow: hidden;
            height: 100%;    
        }
        body{
            overflow: auto;
            height: 100%;
        }
    }
    

提交回复
热议问题