Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Coding html email with Google Inbox (auto-resizing)

Trying to create an Email newsletter that displays correctly in mobile apps, but Google Inbox's auto-resizing feature breaks the layout.

I tried using min-width inline each element (a trick that works with the gmail app), but sadly it had no effect in Inbox. Also, unlike in the Gmail App, there is no option to disable auto-resizing in the message.

Any suggestions?

like image 476
Dovid Levine Avatar asked Oct 18 '25 16:10

Dovid Levine


2 Answers

I ran into the same thing. It turns out if you use the !important declaration, it works. For example:

<div style="width: 100% !important; min-width: 100% !important;"></div>

This worked for me on the Gmail app and the Inbox app.

like image 152
getsnoopy Avatar answered Oct 20 '25 06:10

getsnoopy


Have noticed the same thing. What has been working for me on some email templates is to remove min-width and add an inline style of margin:0 auto; to each table, this will at least align content down the center. Please see an example below:

                    <table ${cell_reset} style="${table_reset} width: 300px; margin:0 auto;" width="300" class="container" align="left">
                      <tr>
                        <td style="width:300px;">

                        </td>
                      </tr>
                    </table>

                    <table ${cell_reset} style="${table_reset} width: 300px; margin:0 auto;" width="300" class="container" align="right">
                      <tr>
                        <td style="width:300px;">

                        </td>
                      </tr>
                    </table>
like image 27
Alex Karpov Avatar answered Oct 20 '25 06:10

Alex Karpov



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!