Home>Support>Problem with placing positioned text over stretched background image

Problem with placing positioned text over stretched background image

Hi there,

I’m trying to achieve text over the top of a stretched background image.

This is a good example of what I’m trying to achieve: http://www.ftiinc.org/agriculture/

I’ve tried various ways (all day!) but when I get the type working, the image no longer scales when in responsive view.

I also have a right sidebar widget (and have tried to get it working using a right hand column instead) but still cannot get the desired effect.

I had this in the text widget area CSS:
margin: 300px auto -20px 10%

Which gets everything looking pretty great in desktop mode, but nothing scales responsively.

I have a 100%, Row layout: “Full width stretched” in layout builder. This contains a visual editor widget, with a background image specified. I’ve used the editor within the widget to add the text and CSS in Widget Styles – Attributes

Thanks for your help!

PS I have a “Coming Soon” homepage, would love it if you could take a look, I can supply my WP login details

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, 22 days ago Private Message - sazzybee

    This is a private message.

  2. 9 years, 22 days ago sazzybee

    Is there someone that can help with this?
    I would be happy to pay an addition fee to the premium to get this resolved.

    Thanks!

  3. 9 years, 22 days ago Andrew Misplon
    Hi, I Work Here

    Hi Sazzybee

    Thanks for reaching out.

    Looks like you know what you’re doing so I’ll just jump straight in. This is the first challenge:

    style="margin: 300px auto -20px 10%;"
    

    Rather use a custom class applied via the Attributes tab. Use Custom CSS to target that class so you can do things like drop the 300px top margin below a given resolution. Something like:

    .custom-hero {
    margin: 300px auto -20px 10%;
    }
    
    @media (max-width: 680px) {
    
    .custom-hero {
    margin: 10% auto -20px 10%;
    }
    
    }
    

    That’s un-tested but you get the idea.

  4. 9 years, 22 days ago Andrew Misplon
    Hi, I Work Here

    The page using the sidebar is the simplest solution. I’d go with that option.

  5. 9 years, 21 days ago Andrew Misplon
    Hi, I Work Here

    The final challenge is that at some point the text is too big for the container. At that point, the image stops re-sizing because the text is sort of holding the container up. The solution to this would be to drop the text size at a breakpoint.

    In your media query you could say:

    @media (max-width: 680px) {
    
    .custom-hero {
    font-size: 80%;
    margin: 10% auto -20px 10%;
    }
    
    }
    

    Or, individually set new font sizes within the media query for the various h tags.

    Page Builder can’t, by default, handle what you’re trying so this puts us into the custom development space we see above.

  6. 9 years, 21 days ago sazzybee

    Hi Andrew,

    Thanks!
    But the background image is not behaving resposively, plus when followed the css above, the typography is way below 80% in appearance, so I’ve had to make the font-size on the heading and sub head on 140% and 100% otherwise it looks tiny.

    I think getting the background image to be responsively is the key, but it’s still not changing with the above instructions.

    Thanks

    Sarah

  7. 9 years, 21 days ago sazzybee

    I should say also that I think my issue is similar to this: Thread: Page Builder background image won’t rescale for mobile devices

    The image on that website does work resposively, again I tried figuring it out but I’m getting more confused!

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

    Hey Sarah :)

    As you can see this is an intermediate level task. We’re not really working with normal Page Builder functionality. The site you originally mentioned in using Layer Slider I believe. It’s a premium product but pretty easy to use. I’ve built sliders with it in the past. So that’s one option to consider.

    You could also try out our Hero widget, it’s part of our Widgets Bundle plugin:
    https://wordpress.org/plugins/so-widgets-bundle/

    With regards to the CSS I sent. You don’t need to use percentage based font sizes in that media query. The main focus there is that, to make everything fit, the font size needs to be decreased so you’re welcome to use px based font sizes inside the query.

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