Make the mails squeezable on narrow screens

This commit is contained in:
Herve Saint-Amand 2017-02-09 21:39:49 +00:00
parent 852cc97707
commit 82a6bb0d5a
2 changed files with 5 additions and 4 deletions

View file

@ -6,14 +6,15 @@
<table style="background-color: #eee; width: 100%">
<tr>
<td style="text-align: center; padding: 0px 7px">
<table style="width: 600px; color: #222; margin-left: auto; margin-right: auto">
<table style="max-width: 600px; color: #222; margin-left: auto; margin-right: auto">
<tr>
<td style="width: 30px; padding: 10px 10px 10px 0px">
<a href="<%= @root_url %>" target="_blank">
<%= image_tag attachments["logo.png"].url, alt: "OpenStreetMap", title: "OpenStreetMap", height: "30", width: "30", border: "0" %>
</a>
</td>
<td style="width: 570px; padding: 0px; text-align: left">
<%# the "width: 100%" here looks wrong, but I couldn't find a better way of making Outlook give this cell full width %>
<td style="width: 100%; padding: 0px; text-align: left">
<%# NB we need "text-decoration: none" twice: GMail only honours it on the <a> but Outlook only on the <strong> %>
<a href="<%= @root_url %>" target="_blank" style="text-decoration: none; color: #000">
<strong style="text-decoration: none; font-size: 18px; font-weight: 600; margin: 0; text-align: left">OpenStreetMap</strong>

View file

@ -1,4 +1,4 @@
<table style="font-size: 15px; margin: 15px 0px; background-color: #eee; width: 565px">
<table style="font-size: 15px; margin: 15px 0px; background-color: #eee; max-width: 565px">
<tr>
<td style="width: 50px; vertical-align: top; padding: 15px">
<%= link_to(
@ -14,7 +14,7 @@
:target => "_blank"
) %>
</td>
<td style="text-align: left; vertical-align: top; padding-right: 10px">
<td style="text-align: left; vertical-align: top; padding-right: 10px; max-width: 550px">
<%= body %>
</td>
</tr>