2

How can this be done? I want the image to shrink with the page width but that doesn't seem possible for outlook. Its seems like it requires a fixed width attribute on the image tag.

I still want a responsive image in gmail though so is it best to do a conditional?

if MSO
<img width=600/>

if !MSO 
<img style="width: 100%"

Or is there a better way?

guynumerouno
  • 157
  • 3
  • 14

1 Answers1

2

Here’s an answer I gave on a similar post recently.

In the Outlook on Windows (from 2007 to 2019, using Word's rendering engine), percentage widths on <img> elements are based on the image file’s physical width, not the parent element’s width as one should expect in CSS. So if your image is 100px wide, width="100%" will equal to 100px. And if your image is 2000px wide, it will equal 2000px. The appropriate solution for Outlook is to use a fixed width in pixels via the HTML width attribute, and use a width:100%; styles for other clients in an inline style (which Outlook will ignore).

HTeuMeuLeu
  • 1,851
  • 1
  • 7
  • 17