How to fix the displayed height of a loop & merge image? | XM Community
Skip to main content
Solved

How to fix the displayed height of a loop & merge image?


Forum|alt.badge.img+2
Hello. My survey has a block in which subjects answer a two-choice question about a loop & merge image. I need all the images to be displayed with the same height dimension, but the images have different aspect ratios, so the width should be scaled in proportion to the height. In the HTML field of the loop & merge question, I have tried: <img src="${lm://Field/1}" style=“height:300;”> <img src="${lm://Field/1}" style="width:auto;height:300;”> <img src="${lm://Field/1}" height=“300”;> These do not seem to change the way the images are displayed., However, confusingly, if I switch the words “height” and “width” these methods work perfectly well to fix the width of the images. Any ideas on how I can fix the height dimension of my images? (Also, applying a CSS class to the img HTML tag did not work, either.) Thanks!

Best answer by TomG

Set the min and/or max heights, and you don't need to set width: ``` <img src="${lm://Field/1}" style="max-height:300px;min-height:300px”> ```
View original

3 replies

PeeyushBansal
Level 6 ●●●●●●
Forum|alt.badge.img+39
  • Level 6 ●●●●●●
  • 1144 replies
  • October 6, 2018
In the image library you can upload all images of same dimensions. Doing so when you will pipe , they all will be of same size.

Forum|alt.badge.img+2
  • Author
  • 5 replies
  • October 6, 2018
Thanks. However, I have over 200 images and will be running more in the future. Because it works to fix width it seems there must be a simple reason (and possibly work-around) for why it doesn't work with height.

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 5929 replies
  • Answer
  • October 6, 2018
Set the min and/or max heights, and you don't need to set width: ``` <img src="${lm://Field/1}" style="max-height:300px;min-height:300px”> ```

Leave a Reply