Specify email image width both in attributes and style
authorTobias Bussmann <t.bussmann@gmx.net>
Tue, 2 Dec 2025 21:28:51 +0000 (22:28 +0100)
committerMagnus Hagander <magnus@hagander.net>
Tue, 2 Dec 2025 21:28:51 +0000 (22:28 +0100)
Apparently Apple mail ignores the width/height if specified in
attributes, but work in style, so let's do both.

Ref: https://www.caniemail.com/features/html-width/, point 3.

templates/news/mail/pgproject.html

index 55ddc2a054ca746edcf0057ff4253b9ccdd3e6e0..0c98726ad0c52cc88d8e67bdb23d2e2e9b967df2 100644 (file)
@@ -4,8 +4,8 @@
 
 {%block content%}
 <div>
-  <img style="float: left" height="50" width="50" src="cid:slonik.png" alt="PostgreSQL logo">
-  <img style="float: right" height="50" width="50" src="cid:slonik.png" alt="PostgreSQL logo">
+  <img style="float: left; width: 50px" height="50" width="50" src="cid:slonik.png" alt="PostgreSQL logo">
+  <img style="float: right; width: 50px" height="50" width="50" src="cid:slonik.png" alt="PostgreSQL logo">
   <h1>{{news.title}}</h1>
 </div>
 {{news.content|markdown}}