How can I constrain maximum width for images hosted on a url, and displayed using Text (Formula)?

  • 0
  • 1
  • Question
  • Updated 4 years ago
  • Answered
I tried these two formulas: 

"<img width=\"625\" src='" & [image_url] &"'>"


"<img max-width=\"625\" src='" & [image_url] &"'>"  

With width=625, large images were constrained, but small images were upsized, which is not the desired behavior. 

With max-width, images with width less than 625 were not upsized, but images with width greater than 625 were not constrained.
Photo of Kate

Kate

  • 0 Points

Posted 4 years ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,224 Points 20k badge 2x thumb
"<img style='max-width: 625' src='" & [image_url] &"'>"
Photo of Kate

Kate

  • 0 Points
Hello,

Thanks for your quick reply. Your solution did not exactly solve it. However, i added "px" to the max-width value, and that seemed to do the trick. I don't see why that would be, but I'll take it!

Thank you so much!

solution: "<img style='max-width:625px' src='" & [image_url] &"'>"
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,224 Points 20k badge 2x thumb
My bad - there is no default CSS units so you have to specify it. Some browsers may take a guess if omitted.
Photo of Kate

Kate

  • 0 Points
Thanks again!!