I’m struggling with responsive images as backgrounds. We all know that we can either set an entire section with an image background (which is easiest) however, it is very limiting to do that (no chance at doing fancy stuff like blending modes and/or parallex effects).
So I have covered an entire section with an image and applied a blending mode (see picture).
What I am trying to figure out, is the best way to make this responsive when adjusting the browser window (and later when on mobile devices). Here is a screenshot of an extreme example when one decreases the size of the browser window:
As you can see, the image adjusts to stay proportional and then creates an “empty” space beneath. It is important at this stage to mention that my section height is fixed at 100vh.
Does anyone have a good way to work around this? I.e. make the image grow in size to prevent the dreaded “empty space” from appearing?
Thanks to everyone who took the time to read this far
Thanks for the great response. It’s almost perfect - the issue now is that when I make the image 100vh, that it squashes the image slightly; which distorts the image of course.
Otherwise, the code worked to solve the issue. Do you know how I can fix this “squashing”.
Hm… no it still doesn’t work right. Check smaller breakpoints to see it squished. I’ll look into it out later, see if you can fix it by yourself meanwhile.
Actually it was me being inattentive to your layout and you not following my advice to the letter
You put custom code into the page settings while I suggested creating an embed element and putting it inside so that you may see the effects right in the designer without publishing. Hence I was unable to see any changes since I didn’t look at the published version! If you do the embed trick you will see the results of styling instantly.
No, you do not need a min height for this to work, just a regular height will do (at least it works for me when I do changes on your read-only)