I’m trying to have a column with a width of 600px and a max-width of 100%
<table style="width:600px;max-width:100%" id="my-table">
<tbody>
<tr>
<td> </td>
<td > <img style="width:600px;max-width:100%"> </td>
<td> </td>
</tr>
</tbody>
</table>
I tried this in gmail in Samsung Internet and in Firefox, and in both cases it’s showing a width bigger than the screen. I also tried adding
<style>
@media screen and (max-width:500px) {
table {
max-width: 350px !important;
}
}
</style>
but it does not work either. It does work on the Gmail app though
3
Answers
Gmail and some email clients have limited support for CSS, and the styles might not render as expected. You can try this:
One thing I always do is to ensure that my webpage displays the same to achieve that I set / unset default page parameters.
In your case you can try to maybe force the html and body width and height attribute to 100% in your CSS file.
Also check your paddings and margins which can sometimes cause you a lot of troubles.
Gmail mobile webmail does not support
<style>
tags and media queries. https://www.caniemail.com/features/css-at-media/