Background
( This has been asked before, many times, I know. However, it seems to have been caused by different things each time. I have gone through about four different StackOverflow answer threads and tried everything. Nothing seems to be working anymore, so I believe this is a new problem. )
Anyway, I have an HMTL element with a background image that needs to be fixed, using background-attachment:fixed;
- All desktop browsers - Works
- Mobile Firefox - Works
- Default Android/Samsung Browser - Works
- Mobile Chrome - Doesn't Work
I've spun the problem into a more simple replicable test, which is a single section
element, set to200%
of the page height, with the background being full-screen and fixed.
Code
html,body {
padding:0;
margin:0;
height:100%;
width:100%;
}
section {
background-position:center center;
background-attachment:fixed;
background-size:cover;
background-image:url(http://www.andymercer.net/wp-content/themes/andymercer/images/background/home.png);
height:200%;
width:100%;
}
<section>Test</section>
JSFiddle For Testing
For easier testing on your smartphone than a code snippet: http://jsfiddle.net/LerLz1L2/
Things I've Tried
backface-visibility: hidden;
-webkit-backface-visibility:inherit;
-webkit-transform: translate3d(0,0,0);
- Setting element and all parents to
position:static