Howdy!
I am trying to accomplish a fully responsive version of this design/layout: www.forkc.org.
Specifically the sections causing me problems are the images with the curved edges with the white text boxes laid on top.
It looks great in desktop but in mobile we have some issues (the text boxes at the bottom have an overflow/overlap problem, and the fact that I’m using min-height to show the full background image is causing weird gaps on mobile).
I have my container set to “contain” and “center” for bg size and position.
I have tried the following solutions:
-
Changing the min-height on the containers using media queries in a child theme. The div changes size but the image doesn’t resize as expected and we get overlapping of sections, weird margins, etc. No example to show at this moment but I could try to recreate if needed.
-
The handy “responsive background image” solution that consists of setting the container height to 0 and adding padding-bottom in a percentage appropriate to the aspect ratio of the image. I creating a class called .swoosh and assigning it to the containers but it seems to be overwritten.
My CSS looks like the following:
.swoosh{margin: 0 30px; height: 0; padding-bottom: 76%:}
(doesn’t work: (no idea why this div is laying on top of the other one):
- I’ve then tried various types of positioning rules on the white text box to get it to sit at the farthest left edge (left: 0) with a top positioning of approximately 50%.
I can get it working in desktop (as seen by our live site) but when I resize in mobile, it all goes to hell lol.
What I want is:
A fully responsive background image that shows the curved edges of the image (so contain, not cover) that resizes smoothly without cropping or overlapping with the white text boxes and text to resize accordingly while holding their position of being approximately half way down the image and approximately 33% of the width of the image.
Our current solution where the white box goes to the bottom of the image is also fine, but I need there to be no overflow or overlap.
I’ve explored all the typical solutions for overlapping–clearfix, etc. and am either being overwritten by the theme’s code or missing something obvious.