Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Is there any way to specify the height only for an image and let the width auto adjust?

more options

I am attempting to view images that vary in size. The vertical dimension is the problematic one. So, I tried to set only the width property and allow the width to automatically adjust. One browser, I think it was Safari, would deal with that. The rest of the browsers I tried, including Firefox, would not. If I specify only width, the height will automatically adjust. I know I can manually edit all of the images to fit my screen, but that wouldn't work for other screens. I could also, finally, learn JavaScript, but I'm hoping there is a faster, easier way. Any suggestions?

I am attempting to view images that vary in size. The vertical dimension is the problematic one. So, I tried to set only the width property and allow the width to automatically adjust. One browser, I think it was Safari, would deal with that. The rest of the browsers I tried, including Firefox, would not. If I specify only width, the height will automatically adjust. I know I can manually edit all of the images to fit my screen, but that wouldn't work for other screens. I could also, finally, learn JavaScript, but I'm hoping there is a faster, easier way. Any suggestions?

All Replies (3)

more options

Does this setting in about:config no longer exist? browser.enable_automatic_image_resizing Setting that to true used to resize the image to fit in the window if it was too big.

more options

Is this about standalone images or about images embedded in web pages?

more options

What is your code to constrain the height of the images? Could you give a link to the page?