-
Ramon88
Hi, my client’s website has a problem where it doesn’t show the background image of a container on an Apple tablet. All other devices work perfectly. I cannot reproduce the problem myself as I don’t have an Apple tablet. Could you please advise?
Thank you!
-
Hi there,
The problem is caused by setting the
background-attachment
tofixed
, IOS devices do not like this setting.You will need to change the value of the property to initial on tablet and mobile
Do you have GB Pro? If so, you can do so in the advanced panel.
If you don’t, then try this:
1. Add a CSS class to the container that contains the background image, eg.
hero-container
.
Adding CSS class(es): https://wordpress.com/support/wordpress-editor/adding-additional-css-classes-to-blocks/2. Add this CSS:
@media(max-width: 1025px) { .hero-container { background-attachment:initial; } }
-
Ramon88
Unfortunately, this didn’t resolve the issue. I might add: It used to function properly, but suddenly it stopped working. Maybe that helps in resolving this issue.
-
Alvind
Hi there,
Can you try updating the CSS with this one:
@media(max-width: 1025px) { .hero-container:before { background-attachment:initial !important; } }
-
Ramon88
Unfortunately, that didn’t help either. I made sure to turn caching off. I’ve also changed the container type from standard to flex and tried setting background to scroll instead of fixed.
If I had a iOS device myself I could help with troubleshooting.
Any other suggestions maybe? Thank you!
-
I just cheked with my iPad, the hero image shows correctly after adding the CSS.
-
Ramon88
Thanks for confirming! I just got an update – the problem only arises when the tablet is in landscape :/ Could you please check one last time?
Thank you!
-
the problem only arises when the tablet is in landscape :/ Could you please check one last time?
Yes, I’ve checked both directions.
However, it’s possible that your client’s iPad has a higher resolution, so even with a 1025px breakpoint, the issue still occurs.
In that case, disabling the fixed position for the background image on all devices should fix the problem.
-
Ramon88
Client is satisfied 🙂 Many thanks!!
-
Stephan Koenigk
Hello Ramon, this is a wellknown problem, I wrote a fix for this, maybe this helps too:
Please give the container with the image a class fixedipad
Then put this in your childtheme or additional css:
@media only screen and (min-width: 768px) and (max-width: 1366px) {
.fixedipad {
background-attachment: initial !important;
background-position: 51.0781% -0.560142% !important;
}
} -
You are welcome 🙂
- You must be logged in to reply to this topic.