does a background-attachment of fixed work in iOS5?

前端 未结 3 830
忘掉有多难
忘掉有多难 2020-12-03 21:06

Does this work in > iOS 5?

.element {
    background: url(images/myImage.jpg) 50% 0 no-repeat fixed;
}

I thought that it should, but so far

3条回答
  •  忘掉有多难
    2020-12-03 21:46

    You can potentially get around this using a separate element and position: fixed which does work!

    HTML:

    CSS:

    #Background {
        background: #000 url("img/Background.jpg") no-repeat 50% 0;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: -1
    }
    

提交回复
热议问题