I've always learned, as a good practice ofhtml email integrationI've always been aware of the need to enter the dimensions of an image in an email. And, like many good practices, I didn't always find out why... It's become a reflex. But now it's high time to put it to the test, to see if it really has an impact 😉
Why should I fill in the dimensions of an image?
I recently discovered the main reason for this good practice: if the height and width of the images are set, the email retains its structure, even if the images are not displayed. Let's check! If this isn't true (or no longer applies), delete the attributes width
and height
would save a few kilobytes on the final weight of the HTML file and would pose fewer constraints for responsive.
So, do I need to fill in the dimensions?
Need help?
Reading content isn't everything. The best way is to talk to us.
The good practice is justified! Indeed, according to our tests on EmailonAcid, if the dimensions of an image (width and height) are not filled in, the cell containing the image is reduced to the strict minimum in case of a non-displayed image. The structure of the email is therefore modified.
This does not work WITHOUT widths and heights... But do we have a better rendering WITH ? After tests, it turns out that it is essential to fill in the dimensions of each image within an emailing.
Here is a quick comparison: On the first screenshot, the images are not blocked, everything is displayed correctly. On the second one, however, the images are blocked and the dimensions are not filled in. We can see that the container will be restricted in height to display only the alternative text and the blocked image pictogram. As for the third screenshot, the images are not displayed, but the dimensions are indicated on the image: the cell keeps the height and width of the image. As a result, the structure of the email remains the same.
Leave a Reply