Home>Support>Making images on website responsive?

Making images on website responsive?

Hi there,

I have just discovered that the full width images I am using on my home page are not responsive, that is when viewed on a phone screen for example the image gets chopped in half. I am hoping there is a way to make these images work so they work on all screen sizes.

Hoping for a solution.

Many thanks

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

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

    Hi Kylie

    Do you have a public URL where we can take a look at what’s going on? If you need to keep this URL private from other users, just select “Private Reply” on the bottom right of the comment box.

  2. 8 years, 10 months ago Kylie Nicholls

    Hi Andrew

    Site is healthykinect.net

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

    Thanks.

    The behaviour you’re seeing is expected from the markup being used:

    <div style="padding: 10px;background-image: url(http://healthykinect.net/wp-content/uploads/2015/11/woman-edit.jpg);background-size: cover;" class="panel-widget-style">

    What you see is normal for how background-size: cover works.

    background-size: 100%;

    The above will give you the result you’re looking for. But, now you’ll need to also introduce:

    background-repeat: no-repeat;

    Next you’ll find there is a big space that’s not being used. That’s because of markup like below which isn’t responsive:

    <span style="display:block;clear:both;height: 0px;padding-top: 650px;"></span>

    You’d need to do something like this instead:

    <span class="650-spacer"></span>

    Then at Appearance > Custom CSS:

    @media (min-width: 680px) {.650-spacer {display:block;clear:both;height: 0px;padding-top: 650px;}}
  4. 8 years, 10 months ago Kylie Nicholls

    Thanks Andrew,

    I have to say Im a little lost with the above code – where does this relate to – that is where does this code sit? Im sorry to be a pain but are you able to explain a little bit further what needs to go where etc…

    Thanks heaps
    Kylie

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

    No problem. All of the code above is inline in your widgets. Was there perhaps someone else involved in the website build?

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

    Would it be possible for you to create a temporary admin account for us so we can log in and take a look? You can create the account with the following email address:

    [email protected]

    Just navigate to Users > Add New in your WordPress admin. Enter siteorigin for the username and [email protected] for the email address. Make sure you’ve selected Administrator for the role and enabled the “Send Password” field so we receive the details.

    Once we’re finished taking a look, you can delete this account. We’ll let you know when to do that.

  7. 8 years, 10 months ago Private Message - WordPress

    This is a private message.

  8. 8 years, 10 months ago Kylie Nicholls

    Hi Andrew,

  9. 8 years, 10 months ago Private Message - Andrew Misplon Hi, I Work Here

    This is a private message.

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

    You were using a shortcode for the spacer in the first widget on the home page. I’ve changed that to a manual spacer:

    <span class="650-spacer"></span>
    

    Which I’ve targetted at Appearance > Custom CSS so we can drop the space for mobile.

    Background size “cover” is coming from row settings in the same place you set the background image. I’ll try use Custom CSS quickly to change that to 100% so you can see the difference in methods.

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

    Break down of steps taken:

    1. First Visual Editor widget on home page edited. Changed shortcode spacer with custom spacer which looks like this:

    <div class="spacer"></div>
    

    2. Editing the row, click Attributes, added a row class in the first field:

    percent-100-bg
    

    3. Added the following at Appearance > Custom CSS to target the above classes (x2):

    /* Custom Spacer */
    
    @media screen and (min-width: 1480px) {
    	.spacer {
    		display: block;
        clear: both;
        height: 0;
        padding-top: 650px;
    	}
    }
    
    /* 100% width background images */
    
    .percent-100-bg .so-panel > div[style] {
      background-repeat: no-repeat;
      background-size: 100% !important;
    }
    

    The above does:

    1. Makes our spacer stop adding space below 1480px resolution.
    2. Changes the background image size from “cover” to 100%. You originally set the background image size when adding the background image by editing the Visual Editor widget and clicking Design on the right.

    You can just pretend we started our discussion here and ignore all that came before :)

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

    I’ve tried one last thing to improve this. I’ve changed the spacer to the following:

    .spacer {
      display: block;
      clear: both;
      height: 0;
      padding-top: 50%;
    }
    

    Making the padding a percentage. It helps a bit.

  13. 8 years, 10 months ago Kylie Nicholls

    Thanks Andrew

    I don't understand it all but that's ok! Really appreciate the help.

    Kylie

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

    For sure :)

  15. 8 years, 9 months ago Kylie Nicholls

    Hi Andrew,
    I have changed the masthead background colour many times and hit saved and publish but when I go back to view site it hasn't changed. Not sure why – successfully changed menu colour etc…
    Site is healthykinect.net

  16. 8 years, 9 months ago SiteOrigin
    Hi, I Work Here

    Hi Kylie

    Your masthead background color is being set at the top of your Custom CSS:

    #masthead.site-header {
      color: #52728e;
      background-color: #475e6d;
    }

    Which rule are you editing? Which color are you trying to change it to?

  17. 8 years, 9 months ago Kylie Nicholls

    Ok, I will try editing in there I was changing in Customise – it changed in customise screen but didn't carry over to site view.

  18. 8 years, 9 months ago SiteOrigin
    Hi, I Work Here

    If you’d like to use the Customizer for this change then ideally, remove the Custom CSS rule.

  19. 8 years, 9 months ago Kylie Nicholls

    Cool, thanks for your help :-)

  20. 8 years, 9 months ago SiteOrigin
    Hi, I Work Here

    Glad we could assist. All the best :)

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