Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Background-attachment: fixed not working on android/mobile

I'm developing a cordova app and I'm trying to get a fixed background. Unfortunately, it doesn't seem to be working, and anytime I scroll down the background simply goes off the top of the page. Here's the CSS I'm using to do this (and I've tried it several other ways):

html {
    width:100%;
    height: 100%;
    background-color:#000000;
    background-image:url('../img/bg_reader.jpg');
    /*background-repeat:no-repeat;
    background-attachment: fixed;
    background-position: center;*/
    background-size: 100% 100%;
}

No matter what, the background scrolls off the top of the screen when I scroll down as if the fixed property weren't set.

like image 940
Nathan Avatar asked Jul 15 '13 22:07

Nathan


1 Answers

Have you tried this?


    html, body {
        height: 100%;
    }
    html {
        overflow-y: hidden;
    }
    body {
        overflow-y: scroll;
        background-color:#000000;
        background-image:url('../img/bg_reader.jpg');
    }

like image 87
szmegma Avatar answered Sep 18 '22 14:09

szmegma