Background image in container

User 219465 Photo


Registered User
324 posts

I have a background image in a container and I want it to stretch and shrink within the container. Right now it seems to be at a set size and does not flow with the container size. I have used other themes that has images that do that, compared the settings but no luck. Any ideas, or videos?
User 379556 Photo


Registered User
1,533 posts

I do the following.

1. I give the container a width and height with the same proportions (but not necessarily the same pixel/rem sizes) as the image. For example, when using a 4x3 image one might set the container to width 40vw and the height to 30vw.
2. I set the Size entry of the container's Design > Background section to 'Contain'.

An example is attached.

Frank
Attachments:

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.