Fixed
Status Update
Comments
cc...@gmail.com <cc...@gmail.com> #2
Yes, this is a deficiency in our current design. We don't have a short term solution or workaround.
ko...@gmail.com <ko...@gmail.com> #3
After 3 months of last reply, do we have any solution yet for background-
attachment:fixed; issue on Android?
attachment:fixed; issue on Android?
cc...@gmail.com <cc...@gmail.com> #4
Not yet. We are working on it.
to...@gmail.com <to...@gmail.com> #5
One workaround is to set the background color transparent and then change the
background image to what you want. This will act similarly to a fixed background,
one draw back is that you have to be able to control the web page html (versus any
website on the web).
view = (WebView) findViewById(R.id.entry_view);
....
view.setBackgroundColor(0); // make the background transparent
view.setBackgroundResource(R.drawable.entrybg); // give it the right background
Note - be sure to remove any "background" style on the webview html.
background image to what you want. This will act similarly to a fixed background,
one draw back is that you have to be able to control the web page html (versus any
website on the web).
view = (WebView) findViewById(R.id.entry_view);
....
view.setBackgroundColor(0); // make the background transparent
view.setBackgroundResource(R.drawable.entrybg); // give it the right background
Note - be sure to remove any "background" style on the webview html.
[Deleted User] <[Deleted User]> #6
Found a way to fix this, if it hasn't been already. When doing it instead of:
background-attachment: fixed;
Do:
background-attachment: scroll;
For some reason it will stop that awkward scrolling effect of the browser. It works
for me on my mobile site for android. fixed itself does not.
Hope this helps!
background-attachment: fixed;
Do:
background-attachment: scroll;
For some reason it will stop that awkward scrolling effect of the browser. It works
for me on my mobile site for android. fixed itself does not.
Hope this helps!
sa...@gmail.com <sa...@gmail.com> #7
how is the fix for this issue coming along?
cc...@gmail.com <cc...@gmail.com> #8
sammorris: This forum is for bug reporting. I can't comment on status here.
da...@gmail.com <da...@gmail.com> #9
Still not fixed huh?
jp...@gmail.com <jp...@gmail.com> #10
It seems the turnaround posted on the comment 4 is no longer possible in from android 2.2. ( issue http://code.google.com/p/android/issues/detail?id=14749 ).
I'm angry about these bugs that are far from being neglectable and that are ignored by the team.
I'm angry about these bugs that are far from being neglectable and that are ignored by the team.
ck...@gmail.com <ck...@gmail.com> #11
this example is perfect but sir i learn android self so please help me where write this css code in android.. in which file write this code ??please help me
[Deleted User] <[Deleted User]> #12
We will be posting a fix to this on our blog at blackbirdi.com .. Sine most mobile browsers do not support the fixed background image we had to find a way to work around the issue and keep the bugs out. We have completed multiple fixes with no problems
Here is an example
testakron.cravespot.com
I am not sure how long the exampel link will be live so pif it is down then please check out the blog
Here is an example
I am not sure how long the exampel link will be live so pif it is down then please check out the blog
jr...@android.com <jr...@android.com> #13
Support for this was added in Jellybean 4.1.
mc...@gmail.com <mc...@gmail.com> #14
Will this be ported in Chrome for Android ??
de...@gmail.com <de...@gmail.com> #15
Still have the same problem with android 4.2
[Deleted User] <[Deleted User]> #16
OK. Seriously, 4 years later and this issue STILL presents itself? Confirmed issue still exists on Android 4.1.
rb...@gmail.com <rb...@gmail.com> #17
First… I make to claim to be either a CSS or Android OS expert. Just sharing what I discovered... A suggestion for Android’s seeming lack of ability to center a background image specified in the CSS.
Typically the background image is specified within the body parameter of the CSS.
Original CSS:
body {
background:url('../images/thematic/header.png');
background-repeat:no-repeat;
background-position:center 10px;
margin:0 auto 30px auto;
} #wrap {
padding:0 0 20px 0;
margin-top: 200px;
margin-left: auto;
margin-right: auto;
width: 1024px;
background-color:#FFFFFF;
} #header {
margin:0 30px 0 30px;
In my experiments with Android, I noticed that all the other DIVs within the body behaved correctly, including centering, so I moved image to another DIV and it worked.
Updated CSS:
body {
margin:0 auto 30px auto;
padding:0;
} #wrap {
padding:0 0 20px 0;
margin-top: 0;
margin-left: auto;
margin-right: auto;
width: 1024px;
background-color:#FFFFFF;
} #header {
background:url('../images/thematic/header.png');
background-repeat:no-repeat;
background-position:center 10px;
margin:0 30px 0 30px;
padding-top:200px;
Typically the background image is specified within the body parameter of the CSS.
Original CSS:
body {
background:url('../images/thematic/header.png');
background-repeat:no-repeat;
background-position:center 10px;
margin:0 auto 30px auto;
} #wrap {
padding:0 0 20px 0;
margin-top: 200px;
margin-left: auto;
margin-right: auto;
width: 1024px;
background-color:#FFFFFF;
} #header {
margin:0 30px 0 30px;
In my experiments with Android, I noticed that all the other DIVs within the body behaved correctly, including centering, so I moved image to another DIV and it worked.
Updated CSS:
body {
margin:0 auto 30px auto;
padding:0;
} #wrap {
padding:0 0 20px 0;
margin-top: 0;
margin-left: auto;
margin-right: auto;
width: 1024px;
background-color:#FFFFFF;
} #header {
background:url('../images/thematic/header.png');
background-repeat:no-repeat;
background-position:center 10px;
margin:0 30px 0 30px;
padding-top:200px;
ca...@gmail.com <ca...@gmail.com> #18
STILL an issue in Android regardless of browser used.
an...@gmail.com <an...@gmail.com> #19
Still an issue in Android 4.1.2
gu...@gmail.com <gu...@gmail.com> #20
seriously.. a 4 year old bug that prevents websites from rendering properly... the downside of opensource.. everyone has something "sexier" to develop than to fix bugs
di...@gmail.com <di...@gmail.com> #21
My background image works on every browser but Chrome for Android.. Background is pushed up. Website looks perfect in the native samsung browser for android.
jc...@gmail.com <jc...@gmail.com> #22
I have found a workaround for background image problems on Chrome for Android: apply the css to the html tag, not the body tag. Example:
html {
background: url(bg.png);
background-position: center;
background-attachment: fixed;
background-repeat: no-repeat;
}
html {
background: url(bg.png);
background-position: center;
background-attachment: fixed;
background-repeat: no-repeat;
}
pr...@gmail.com <pr...@gmail.com> #23
I've tried some of these workarounds, but here's the solution I found (no html changes needed):
html, body {
height: 100%;
}
html {
overflow-y: hidden;
}
body {
overflow-y: scroll;
}
body {
background: [whatever];
}
html, body {
height: 100%;
}
html {
overflow-y: hidden;
}
body {
overflow-y: scroll;
}
body {
background: [whatever];
}
co...@gmail.com <co...@gmail.com> #24
#23 preotgee...@gmail.com
I've tried some of these workarounds, but here's the solution I found (no html changes needed):
html, body {
height: 100%;
}
html {
overflow-y: hidden;
}
body {
overflow-y: scroll;
}
body {
background: [whatever];
}
This worked, Thanks for sharing, been searching for a long time.
I've tried some of these workarounds, but here's the solution I found (no html changes needed):
html, body {
height: 100%;
}
html {
overflow-y: hidden;
}
body {
overflow-y: scroll;
}
body {
background: [whatever];
}
This worked, Thanks for sharing, been searching for a long time.
em...@gmail.com <em...@gmail.com> #25
[Comment deleted]
em...@gmail.com <em...@gmail.com> #26
I've tried some of these workarounds, but here's the solution I found (no html changes needed):
html, body {
height: 100%;
}
html {
overflow-y: hidden;
}
body {
overflow-y: scroll;
}
body {
background: [whatever];
}
This actually worked for fixing the background on chrome for android, but it breaks two finger scrolling for synapsis touchpads (windows) and up/down arrow scrolling in Chrome for Desktop.
html, body {
height: 100%;
}
html {
overflow-y: hidden;
}
body {
overflow-y: scroll;
}
body {
background: [whatever];
}
This actually worked for fixing the background on chrome for android, but it breaks two finger scrolling for synapsis touchpads (windows) and up/down arrow scrolling in Chrome for Desktop.
pr...@gmail.com <pr...@gmail.com> #27
You're right about it breaking up/down arrow scrolling. If you click on the page arrow scrolling begins to work. I haven't figured out a workaround for this.
an...@gmail.com <an...@gmail.com> #28
The solution is browser sniffing and only applying the fix to Android devices.
he...@gmail.com <he...@gmail.com> #29
Yeah, after 4 years we, developers, found a workaround. The problem is how concerning is the fact that Google doesn't give a f. for a basic bug. Are they trying to kill webview development in Android?? This is, at least, a shame for Google, who has billions to spend in qualified personal...Apple's iOS devices don't have this bug, Windows Phone too.
to...@gmail.com <to...@gmail.com> #30
#23 preotgee...@gmail.com
I've tried some of these workarounds, but here's the solution I found (no html changes needed):
html, body {
height: 100%;
}
html {
overflow-y: hidden;
}
body {
overflow-y: scroll;
}
body {
background: [whatever];
}
This workarround is perfekt!
I use it in my project and make a little update
html, body {
height: 100%;
}
html {
overflow-y: hidden;
}
body {
overflow-y: scroll;
background: [whatever];
background-size: 100% 100%;
}
Thanks
P.S.: Visit my blog atwww.tobias.feldmeth.de , thx
I've tried some of these workarounds, but here's the solution I found (no html changes needed):
html, body {
height: 100%;
}
html {
overflow-y: hidden;
}
body {
overflow-y: scroll;
}
body {
background: [whatever];
}
This workarround is perfekt!
I use it in my project and make a little update
html, body {
height: 100%;
}
html {
overflow-y: hidden;
}
body {
overflow-y: scroll;
background: [whatever];
background-size: 100% 100%;
}
Thanks
P.S.: Visit my blog at
ht...@gmail.com <ht...@gmail.com> #31
4 years and this is still buggy, shame on google...
20...@gmail.com <20...@gmail.com> #32
This works great
html, body {
height: 100%;
}
html {
overflow-y: hidden;
}
body {
overflow-y: scroll;
}
body {
background: [whatever];
}
But it's a bitch when trying to take a screenshot, half the page gets cut off :/
html, body {
height: 100%;
}
html {
overflow-y: hidden;
}
body {
overflow-y: scroll;
}
body {
background: [whatever];
}
But it's a bitch when trying to take a screenshot, half the page gets cut off :/
[Deleted User] <[Deleted User]> #33
This worked pretty well to me =)
html, body {
height: 100%;
}
body {
overflow-y: scroll;
}
body {
background: url("../images/background.png");
}
html, body {
height: 100%;
}
body {
overflow-y: scroll;
}
body {
background: url("../images/background.png");
}
th...@gmail.com <th...@gmail.com> #34
This was my workaround that worked fine so far.
Use the background in the css of the html, and set a min-height with the approximate size of your content when using the small screen.
html {
min-height: 752px;
background: url(/images/background.jpg) no-repeat fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
}
html, body {
width: 100%;
height: 100%;
}
Use the background in the css of the html, and set a min-height with the approximate size of your content when using the small screen.
html {
min-height: 752px;
background: url(/images/background.jpg) no-repeat fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
background-size: cover;
}
html, body {
width: 100%;
height: 100%;
}
[Deleted User] <[Deleted User]> #35
I had the same issue. Setting the background to scroll was the best fixed for me.
ar...@gmail.com <ar...@gmail.com> #36
I fixed by removeing the fixed value from background, and moving the background on a <div> with position fixed and 100% height and width.
ne...@gmail.com <ne...@gmail.com> #37
la...@gmail.com <la...@gmail.com> #38
#37 newoffic...@gmail.com
I found the same solution as #36 arsenalw...@gmail.com
[CSS]
#background {
position: fixed;
width: 100%;
height: 100%;
background: url(/images/background.jpg) no-repeat;
}
[HTML]
<html>
<body>
<div id="background"></div>
<div id="content">...</div
</body>
</html>
I found the same solution as #36 arsenalw...@gmail.com
[CSS]
#background {
position: fixed;
width: 100%;
height: 100%;
background: url(/images/background.jpg) no-repeat;
}
[HTML]
<html>
<body>
<div id="background"></div>
<div id="content">...</div
</body>
</html>
lo...@gmail.com <lo...@gmail.com> #39
It´s the same if you set this in your webview:
webView.setBackgroundColor(0);
WebView.setBackgroundResource(R.drawable.yourImage);
This work perfectly for me! don´t forget put the body background-color in your html to transparent.
:P
webView.setBackgroundColor(0);
WebView.setBackgroundResource(R.drawable.yourImage);
This work perfectly for me! don´t forget put the body background-color in your html to transparent.
:P
re...@gmail.com <re...@gmail.com> #40
i hope this helps :
#background {
background:url(../img/backimages.png) no-repeat center center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
works for me, and dont use fixed css for mobile
#background {
background:url(../img/backimages.png) no-repeat center center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
works for me, and dont use fixed css for mobile
kr...@gmail.com <kr...@gmail.com> #41
The tip with #background {position:fixed;...} causes glitches in IE (at least 11).
The background-div (#background) shakes when the user scrolls down or up (it looses its position for a short time everytime you scroll and then gets its position back, which causes "jitter" / disturbing movement).
Tested on a pretty good machine (not a performance issue, I'd say) on Windows 8. It's annoying that background-fixed is not working for the android-browser..
None of the tips worked for me. Admittedly, my Android Testing Device is 4.0.4 and outdated.
The only tip that would have worked, was
html {
overflow-y: hidden;
}
body {
overflow-y: scroll;
}
But that temporarily cuts content when scrolling on the android device (weird behavior, that you definitely don't want on your page).
I would give up and fall back to repeat-y but even that wouldn't work on my android-device. Damn it.
Can't use a wrapper div, because the background-size must cover the viewport, not the content (long pages would mess the background-image, would be too large).
The background-div (#background) shakes when the user scrolls down or up (it looses its position for a short time everytime you scroll and then gets its position back, which causes "jitter" / disturbing movement).
Tested on a pretty good machine (not a performance issue, I'd say) on Windows 8. It's annoying that background-fixed is not working for the android-browser..
None of the tips worked for me. Admittedly, my Android Testing Device is 4.0.4 and outdated.
The only tip that would have worked, was
html {
overflow-y: hidden;
}
body {
overflow-y: scroll;
}
But that temporarily cuts content when scrolling on the android device (weird behavior, that you definitely don't want on your page).
I would give up and fall back to repeat-y but even that wouldn't work on my android-device. Damn it.
Can't use a wrapper div, because the background-size must cover the viewport, not the content (long pages would mess the background-image, would be too large).
kr...@gmail.com <kr...@gmail.com> #42
Maybe someone is interested in this workaround that works for me:
It uses the tip with the fixed positioned div (#background{position:fixed}) but by performing a basic User-Agent-Detection, this will only be applied to android-devices (so the jitter / shaking in IE goes away).
For all Browsers and devices _not_ being android, the background-image is applied to the body with background-position:fixed. Nothing special here.
Server-Side User-Agent-Detection applies a class "android" to the <html>-tag -> <html class="android" >, if it is an Android-User-Agent, otherwise no class.
Using the #background div mentioned above, the android specific CSS can then look like this:
.android #background{
position:fixed;
width:100%;
height:100%;
background-image:inherit; /* uses the image from body */
background-size:cover;
background-position: 50% 50%;
background-repeat:no-repeat;
}
Example in more detail:
php User-Agent-Detection:
public function isAndroid(){
return(stripos($_SERVER['HTTP_USER_AGENT'], 'android')!==false);
}
example html / php just to show an example, I'm not actually using inline-php
<html class="<?php if(isAndroid()){echo 'android';} ?>">
...
<body>
<div id="background"></div>
...
</body>
CSS:
body{
background-image:url(myimage.jpg);
background-repeat:no-repeat;
background-position:50% 50%;
background-size:cover;
background-attachment: fixed;
}
.android #background{
position:fixed;
width:100%;
height:100%;
background-image:inherit; /* uses the image from body so you don't need to define it twice, you could as well define your image using 'url(myimage.jpg)'*/
background-size:cover;
background-position: 50% 50%;
background-repeat:no-repeat;
}
When using this, be aware, that android user-agents will display the background-image in the body _and_ in #background. This fact just doesn't matter for me.
Also be aware that this is very basic User-Agent-Detection and might not work 100%.
It uses the tip with the fixed positioned div (#background{position:fixed}) but by performing a basic User-Agent-Detection, this will only be applied to android-devices (so the jitter / shaking in IE goes away).
For all Browsers and devices _not_ being android, the background-image is applied to the body with background-position:fixed. Nothing special here.
Server-Side User-Agent-Detection applies a class "android" to the <html>-tag -> <html class="android" >, if it is an Android-User-Agent, otherwise no class.
Using the #background div mentioned above, the android specific CSS can then look like this:
.android #background{
position:fixed;
width:100%;
height:100%;
background-image:inherit; /* uses the image from body */
background-size:cover;
background-position: 50% 50%;
background-repeat:no-repeat;
}
Example in more detail:
php User-Agent-Detection:
public function isAndroid(){
return(stripos($_SERVER['HTTP_USER_AGENT'], 'android')!==false);
}
example html / php just to show an example, I'm not actually using inline-php
<html class="<?php if(isAndroid()){echo 'android';} ?>">
...
<body>
<div id="background"></div>
...
</body>
CSS:
body{
background-image:url(myimage.jpg);
background-repeat:no-repeat;
background-position:50% 50%;
background-size:cover;
background-attachment: fixed;
}
.android #background{
position:fixed;
width:100%;
height:100%;
background-image:inherit; /* uses the image from body so you don't need to define it twice, you could as well define your image using 'url(myimage.jpg)'*/
background-size:cover;
background-position: 50% 50%;
background-repeat:no-repeat;
}
When using this, be aware, that android user-agents will display the background-image in the body _and_ in #background. This fact just doesn't matter for me.
Also be aware that this is very basic User-Agent-Detection and might not work 100%.
an...@gmail.com <an...@gmail.com> #43
This workarround is prefect on Android 4.2.2 !
I use it in my wordpress project only on home-page (domainedegardanne.com ) and make a little update:
html, body {
height: 100%;
}
html {
overflow-y: hidden;
}
body.home.page {
overflow-y: scroll;
background: url(http://..jpg) center top;
background-size: center 100%;
}
Thanks a lot
I use it in my wordpress project only on home-page (
html, body {
height: 100%;
}
html {
overflow-y: hidden;
}
overflow-y: scroll;
background: url(http://..jpg) center top;
background-size: center 100%;
}
Thanks a lot
cr...@gmail.com <cr...@gmail.com> #44
At this point, we just passed the six year aniversary of this bug.
Isn't the default android browser made by google? Why does that thing work but chrome not?
All these workarounds didn't work for my site :(
Chrome: 43.0.2357.93
Android: 4.2.2
Isn't the default android browser made by google? Why does that thing work but chrome not?
All these workarounds didn't work for my site :(
Chrome: 43.0.2357.93
Android: 4.2.2
an...@gmail.com <an...@gmail.com> #45
[Comment deleted]
an...@gmail.com <an...@gmail.com> #46
I would also really like to have a fix released. My desktop site works great, and in the element inspector I see that unchecking background-attachment: fixed triggers the issue I'm getting on my mobile device. When will this be resolved?
[Deleted User] <[Deleted User]> #47
really wish this could be fixed, would make my dev life so much easier.
da...@gmail.com <da...@gmail.com> #48
[Comment deleted]
pa...@gmail.com <pa...@gmail.com> #49
That issue just made me a bit embarrassed.... Hope it get updated so I don't have to use something other than CSS.
sa...@gmail.com <sa...@gmail.com> #50
no one of the css tricks provided here is working perfect or has no bad effects for other browsers... please fix!!
an...@gmail.com <an...@gmail.com> #51
7 damn years? SERIOUSLY?
gu...@gmail.com <gu...@gmail.com> #52
Adding my voice to this issue, in the hopes that one day this works like it should.
ko...@gmail.com <ko...@gmail.com> #53
[Comment deleted]
ke...@gmail.com <ke...@gmail.com> #54
blah! problems with this..
ra...@gmail.com <ra...@gmail.com> #55
[Comment deleted]
ge...@gmail.com <ge...@gmail.com> #57
[Comment deleted]
cl...@gmail.com <cl...@gmail.com> #58
woah, can we help get this one resolved? I can help!
gu...@gmail.com <gu...@gmail.com> #59
Adding my voice to this issue, in the hopes that one day this works like it should.
ka...@gmail.com <ka...@gmail.com> #60
This one worked fine for me guys:
html {
height:100%;
min-height:100%;
}
body {
min-height:100%;
}
html {
height:100%;
min-height:100%;
}
body {
min-height:100%;
}
pr...@gmail.com <pr...@gmail.com> #61
Over 7 years now, what a shame!
ma...@gmail.com <ma...@gmail.com> #62
Just discovered it! This is the sort of thing that made me give up web design, but it was always directed at Internet Explorer then. Doesn't look like it's going to be fixed.
gu...@gmail.com <gu...@gmail.com> #63
Hei Chrome team, please ask Firefox team development to help you, becouse you cannot.
kb...@gmail.com <kb...@gmail.com> #64
I don't think any of these workarounds will work for me as I require multiple fixed background images. I have no problems with fixed backgrounds on firefox mobile. For those with a single background image check out this stack overflow thread
http://stackoverflow.com/questions/26372127/background-fixed-no-repeat-not-working-on-mobile has a workaround provide by Vincent that has many upvotes, which I have pasted below
I have found a great solution for fixed backgrounds on mobile devices requiring no JavaScript at all.
body:before {
content: "";
display: block;
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: -10;
background: url(photos/2452.jpg) no-repeat center center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
Please be aware of the negative z-index value of -10. html root element default z-index is 0. This value must be the smallest z-index to have it as background.
I have found a great solution for fixed backgrounds on mobile devices requiring no JavaScript at all.
body:before {
content: "";
display: block;
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: -10;
background: url(photos/2452.jpg) no-repeat center center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
Please be aware of the negative z-index value of -10. html root element default z-index is 0. This value must be the smallest z-index to have it as background.
ha...@gmail.com <ha...@gmail.com> #65
Why is this bug closed on Sep 2012 if it's still not fixed yet? Another shameful bug in my collection?!
[Deleted User] <[Deleted User]> #66
soon 8 years.. and still not fixed... wow.
to...@gmail.com <to...@gmail.com> #67
Please fix.
ne...@gmail.com <ne...@gmail.com> #68
it works on the simulated android device in DevTools. Not in the chrrome Browser of my Nexus 5P
xc...@gmail.com <xc...@gmail.com> #69
Still not working, even after 8 years
ia...@gmail.com <ia...@gmail.com> #70
This bug is marked as "Status: fixed" since 2012. Perhaps this bug was originally intended for the old android browser, and now the bug is Chrome's fault?
https://bugs.chromium.org/p/chromium/issues/detail?id=344338#
ra...@gmail.com <ra...@gmail.com> #71
Good job by the Google team on Android Chrome. Lots of threads in the web about this problem on the browser, arrived here because have the same issue, and I can see it is coming from 2010, ¡and marked as Fixed!
re...@gmail.com <re...@gmail.com> #72
2/05/208, still an issue
BTW, the only "fix" for me was this obscenity:
html{
margin: 0;
padding: 0;
height:100%;
min-height:100%;
overflow:auto;
}
body{
margin: 0;
padding: 0;
min-height:100%;
overflow:auto;
}
@media all and (max-width: 768px) {
html {
height: 100%;
background: url('bg-mobile.png') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: 100% 100%;
overflow: hidden;
}
}
@media all and (min-width: 769px) {
html {
background: url('bg.png') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: 100% 100%;
}
}
BTW, the only "fix" for me was this obscenity:
html{
margin: 0;
padding: 0;
height:100%;
min-height:100%;
overflow:auto;
}
body{
margin: 0;
padding: 0;
min-height:100%;
overflow:auto;
}
@media all and (max-width: 768px) {
html {
height: 100%;
background: url('bg-mobile.png') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: 100% 100%;
overflow: hidden;
}
}
@media all and (min-width: 769px) {
html {
background: url('bg.png') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: 100% 100%;
}
}
ad...@gmail.com <ad...@gmail.com> #73
The solution in #64 worked for me, however, as the top bar came in and out of view, the background image would resize, and that was quite jarring.
I fixed this by changing height: 100%; to height: 100vh;
Now it's rock steady.
I fixed this by changing height: 100%; to height: 100vh;
Now it's rock steady.
fr...@gmail.com <fr...@gmail.com> #74
Still doesn't seem to work for me.
ja...@gmail.com <ja...@gmail.com> #75
Still not fixed.
The workaround i took was to use another DIV set to width:100vw, height:100vh, position:fixed, top:0, left:0 with a background image.
The workaround i took was to use another DIV set to width:100vw, height:100vh, position:fixed, top:0, left:0 with a background image.
dr...@gmail.com <dr...@gmail.com> #76
Seriously we're in 2019 and it's still not fixed..
za...@gmail.com <za...@gmail.com> #77
As stated above use another div and nest it within the div you want the fixed background to be. Use this CSS class -
.bg-fixed-fix {
background-attachment: fixed;
background-image: url(../img/back.jpg);
background-repeat: no-repeat;
overflow: hidden;
width: 100vw;
height: 100vh;
position: fixed;
top: 0;
left: 0;
z-index: -10;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
works for both Android and desktop.
.bg-fixed-fix {
background-attachment: fixed;
background-image: url(../img/back.jpg);
background-repeat: no-repeat;
overflow: hidden;
width: 100vw;
height: 100vh;
position: fixed;
top: 0;
left: 0;
z-index: -10;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
works for both Android and desktop.
br...@gmail.com <br...@gmail.com> #78
It. Is. Not. Fixed.
pr...@feip.co <pr...@feip.co> #79
lol
pr...@feip.co <pr...@feip.co> #80
worked in FF btw
ga...@gmail.com <ga...@gmail.com> #81
wtf the fixed background-attachment still doesnt work in chrome on android
vi...@gmail.com <vi...@gmail.com> #82
Shame on google . It's july 2020 ,still this bug is not fixed .
works well on firefox android.
Google even does not look our comments.
Hey google developers, Eat something of firefox developers.
works well on firefox android.
Google even does not look our comments.
Hey google developers, Eat something of firefox developers.
ak...@bloni.in <ak...@bloni.in> #83
SHAME on the chrome team, its been a decade and it is still not fixed!!!!
je...@gmail.com <je...@gmail.com> #84
First of all. This is not the correct issue tracker, you should add it to the Chromium issue tracker. Secondly, on what devices and browsers does this not work on? Did a quick test on the latest Chrome 87 on Android and the latest Chrome 87 on Windows 10. And both worked perfectly fine. At least using this example: https://www.w3schools.com/cssref/tryit.asp?filename=trycss_background-attachment
je...@gmail.com <je...@gmail.com> #85
Sorry, forgot adding the background-position: center. That doesn't work in Chrome 87 on Android. But should still submit this to the Chromium issue tracker instead.
ol...@gmail.com <ol...@gmail.com> #86
Is there an issue to track this in the Chromium issue tracker?
ni...@gmail.com <ni...@gmail.com> #87
It is still not fixed, what are you guys doing?
ma...@gmail.com <ma...@gmail.com> #88
This has been a huge rabbit hole for me, and quite a big headache. How is this still not fixed after 10 years?? 'background-image' works fine on desktop but not on Android Chrome? I don't have a clue how to fix it, even though it seems trivial.
Please someone ;-;
Please someone ;-;
Description
This sample demonstrates the problem:
===========
<html>
<head>
<style>
body {
background: url(bg.png);
background-position: center;
background-attachment: fixed;
background-repeat: no-repeat;
}
</style>
</head>
<body>
Test test test
<br/><br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/><br/>
<br/><br/><br/><br/><br/><br/><br/>
EOF
</body>
</html>
===========
You need a bg image to see the problem (attached).
When you show the page in the Android browser, if you scroll, the
background image doesn't stay fixed in the middle as it should per the "background-attachment: fixed;" css rule.