This is a read-only archive of the Framer Community on Facebook.

What is Framer? Join the Community
Return to index
Dylan Rose
Posted Aug 03 - Read on Facebook

Hi all, is it possible to insert an image via html (so that I can use 'auto' for the image width) and then scale the layer's width (red box) to match the width of the image? For this example I have a set height but I want to be able to pass in different images and scale the layer to match the width of each image.

2 Comments

Jon Madison

hope this helps:

container.html = """<img style="max-width: #{container.width}px; max-height: #{container.height}px; height: auto;" src="#{imageName}"/>"""

Enrique Gonzalez

Koen and Jonas 👆

Read the entire post on Facebook