Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Container background not showing on Apple tablet

  • 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 to fixed, 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;
    }
    }
  • 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.

  • Hi there,

    Can you try updating the CSS with this one:

    @media(max-width: 1025px) { 
       .hero-container:before {
          background-attachment:initial !important;
       }
    }
  • 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.

  • 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.

  • 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   🙂

Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.