Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #677288

    I’ve added a media query at 479px to swap the background image on a “Color Section”

    If you make the screen smaller on a desktop, the image swaps out correctly. However, on an actual mobile device, the background, background-image, or background-position properties do not take. Mobile shows the same image as full-width desktop.

    I’ve successfully tested changing the color on an h1 tag in the same element at the same media call to verify this isn’t a cache issue.

    Does another class override the background properties on mobile?

    #678762

    Hi ClapperConsulting!

    Thank you for using Enfold.

    What is the screen resolution of the mobile device? Or its actual model? Proper css media query for iPad and iPhones: http://stephen.io/mediaqueries/

    Cheers!
    Ismael

    #679223

    Hi Ismael,

    It’s an iPhone 5 that I’m testing on, though I’m told iPhone 6 is not seeing the background property change either.

    The media call is working as I can change other elements that do show up on the phone.

    #680753

    Hi,

    use this code:

    @media screen and (max-width: 479px) {
    .page-id-861 #intro {
    background-size: 376px 677px !important;
    }}
    

    and adjust as needed.

    Best regards,
    Andy

    #681519

    Hi Andy,

    That code performs as expected but ONLY on a desktop. If you view a page with the code on a mobile device – not on a mobile emulator, the code does not get applied. I’ve now tried on an iPhone 5S w/ Safari and a Galaxy S4. Both do the same thing. Though, the S4 seems like it reads the code at first, then reverts back to the original background properties.

    Something is preventing or reverting the code when the physical device is a mobile device.

    I can’t leave your code on the live page, but created a test page noted below: View it on a desktop or emulator and you’ll see the background distort below 479px due to the code you provided (changed to match the page-id). But, if you visit the site from an actual phone, the background does not distort. Showing that the .css property is being applied at the correct media query, but not being applied specifically on a phone.

    • This reply was modified 7 years, 8 months ago by ClapperConsulting. Reason: Clarifying that what the code is doing isn't the issue. The issue is that the code is not applying a device that is a phone
    #682199

    Hi,

    please try this code instead:

    @media only screen and (max-width: 736px) {
    .page-id-861 #intro {
    background-size: 376px 677px !important;
    }}
    

    Best regards,
    Andy

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