Fixed background cover becomes zoomed in mobile view

前端 未结 3 1344
难免孤独
难免孤独 2021-02-14 10:06

I\'m using a fixed background cover for my website here: http://www.datisdesign.com

Every page has a big header image, but in small devices such as mobiles, the cover im

相关标签:
3条回答
  • 2021-02-14 10:36

    Try this one out

    background: url(image.format) no-repeat center center fixed; 
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
    
    0 讨论(0)
  • 2021-02-14 10:43

    I solved my problem by limiting the capability to the large tablet screen size.

    @media screen and (max-width: 992px) {
        #parallax {
            background-attachment: scroll;
        }
    }
    
    0 讨论(0)
  • 2021-02-14 10:44

    Here you go :)

    Add the below to your style...

    background-size:100%;
    width:100%;
    

    I hope this helps

    0 讨论(0)
提交回复
热议问题