Custom background with Mobile

  • Posted in : impressivCard WP
  • mfrazier35
    Participant

    Hello. I have a custom image background. Is there a way to keep it “fixed” for the mobile site? If I scroll down currently the picture scrolls out of frame and I end up with white text on a plain white background.

    ahmetsali
    Keymaster
    ahmetsali
    Keymaster

    Hi, it looks like css background-attachment: fixed property is not supported on some mobile devices. You can use this custom css code, that should work.

    body:before { background: url('images/bckg/office.jpg'); content: ""; position:fixed; z-index:-1; width:100%; height:100%; top:0; bottom:0; left:0; right:0; background-size:cover; background-attachment:fixed; background-repeat: no-repeat; }
    
    mfrazier35
    Participant

    That still doesn’t work on my DROID Razr MAXX. Looks good on the iPhone though.

    ahmetsali
    Keymaster

    What is the android version of your DROID Razr MAXX ?

    mfrazier35
    Participant

    4.0.4

    ahmetsali
    Keymaster

    I checked on android 4.0 and 4.1, and it was fine. I guess some mobile browsers are not good with fixed elements.

    mfrazier35
    Participant

    Hmm.. It’s fine on Firefox mobile, just not the default Android browser. I tried to override the plain white background to something darker in the CSS, but couldn’t figure it out. Is it possible to change the white color behind the custom jpg to another color?

    ahmetsali
    Keymaster

    Do you want to have dark background color for body, then you can use one of predefined colors in css/skins/background/ folder, or you can give any color to body background like this;

    body { background:  #ddd; }
    
    mfrazier35
    Participant

    Awesome. Thanks! I was trying to do it in the Custom CSS.

    PS- Loving the theme and the quickness of the support. I feel like I got a good deal. I’ll be sure to leave 5 stars on Themeforest for you guys!

    ahmetsali
    Keymaster

    Thanks for the rating.

    labnoon
    Participant

    same situation here. used the codes you mentioned in both topics. but it looks bad on iphone4

    ahmetsali
    Keymaster

    @labnoon

    if you can provide your url, i can check what’s wrong.

Viewing 13 posts - 1 through 13 (of 13 total)

The forum ‘impressivCard WP’ is closed to new topics and replies.