-
honzapecenka
Hi, how I can set a responsive container with image background. When I set a fixed height, the image is cropped from the sides. I need height and width to be responsive. Now I have the height set to 100%.
https://prnt.sc/09rCyJOZa2O4
When I insert a block image it works fine. Unfortunately I need a container.
Thanks for help. -
Hi there,
When I set a fixed height, the image is cropped from the sides.
What was the fixed height value you set? Can you try 170px?
Let me know 🙂 -
honzapecenka
I had it set height 100%. When I set the height or min-height to 170px, my image gets cropped when I change the resolution.
-
David
Hi there,
select the Container Block with the background image.
In Advanced > Additional CSS classes add a custom class eg.fixed-aspect
then add this CSS:
.fixed-aspect { aspect-ratio: 16 / 9; width: 100%; }
Adjust the aspect ratio to suit your needs.
-
honzapecenka
Amazing. It works. Thank you David.
-
David
Glad to hear that!
- You must be logged in to reply to this topic.