Home>Support>Masthead background photo

Masthead background photo

I am trying to add a background image to the masthead that stretches the entire width of the page and is responsive to various devices. When I initially uploaded my image, it was 1080 px wide by 420px high. I set the masthead image, but it is showing up twice in the masthead (side by side).

I added the following CSS code:
header#masthead {
background-repeat: no-repeat;
}
and the image shows up only once, but does not stretch the full width of the page.

So I added this CSS code:
header#masthead {
background-repeat: no-repeat;
background-position: center center !important;
background-attachment: fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
Now the image is zoomed in and cut off, so you can’t see the entire image (but it does fit the width of the page now…)

So then I tried:
header#masthead {
padding: 0 !important;
}

header#masthead hgroup {
padding: 0 !important;
}

header#masthead hgroup .logo img {
width: 1080px;
}

.main-navigation {
margin: 0 !important;
}

body.responsive header#masthead hgroup .support-text, body.responsive header#masthead hgroup #header-sidebar {
display: none !important;
}

And now the image is repeating again.

Is there another fix I can try? I am using the Premium Version 2.2.3)

Thanks!
Aleah

URL: http://www.1140balance.com

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 9 years, 8 months ago Aleah Terry

    Also, this is the link to my photo.

    http://www.1140balance.com/wp-content/uploads/2014/12/homeslider.jpg

    In all of the CSS options mentioned above, the photo is not responsive on my iphone or ipad either.
    Thanks!
    Aleah

  2. 9 years, 8 months ago Aleah Terry

    OK. I’ve read a ton of these threads on this topic. I changed the header padding to 210 and that seems to have finally fixed the problem. And things look good on my laptop and my ipad. However, the masthead image on my iphone is not resizing at all (so all I can see on the phone is the very center of the image). Is there a fix for that?

    Thanks!
    Aleah

  3. 9 years, 8 months ago Andrew Misplon
    Hi, I Work Here

    Hi Aleah

    Thanks for reaching out.

    Remove all the Custom CSS you have for this now, back it up and try the following:

    /* Header */
    
    header#masthead {
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: top center;
    }
    
    @media (max-width: 680px) {
    
    header#masthead {
    background-size: 100%;
    }
    
    }
    

    Hope that helps.

  4. 9 years, 8 months ago Aleah Terry

    Hi Andrew,
    It is SO much better, so thank you! The computer and ipad are perfect. On the iphone, the entire image now shows up, but there is a tremendous amount of white space beneath it. You have a scroll a bit before getting to any of the actual page info. Is there a way to reduce that white space (again, this only happens on my iphone).

    Thanks again!
    Aleah

  5. 9 years, 8 months ago Andrew Misplon
    Hi, I Work Here

    You’ll need to re-adjust the header padding for mobile. Insert the following under Appearance >Custom CSS and adjust as required:

    @media (max-width: 680px) {
    
    header#masthead .hgroup {
    padding-top: 210px;
    padding-bottom: 210px;
    }
    
    }
    
  6. 9 years, 8 months ago Aleah Terry

    Andrew,
    Below is the only CSS I have (under Appearance > Custom CSS). I have changed the padding number to everything from 1px to500px and there is no change on the iphone. No matter what number I change it to, there is a large amount of white space below the header image. What am I doing wrong?
    Thanks
    Aleah

    /* Header */

    header#masthead {
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: top center;
    }

    @media (max-width: 680px) {

    header#masthead {
    background-size: 100%;
    }

    header#masthead .hgroup {
    padding-top: 1px;
    padding-bottom: 1px;
    }

    }

  7. 9 years, 8 months ago Andrew Misplon
    Hi, I Work Here

    Give this a try:

    @media (max-width: 680px) {
    
    header#masthead .hgroup {
    padding-top: 210px !important;
    padding-bottom: 210px !important;
    }
    
    }
    
  8. 9 years, 8 months ago Aleah Terry

    You are a genius!! Thank you so much. Changed the top and bottom to 55px and it worked perfectly! Thanks again!

  9. 9 years, 8 months ago Andrew Misplon
    Hi, I Work Here

    Awesome, glad that did the trick.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More