How to set CSS max-width in HTML emails?

Spread the love

Sometimes, we want to set CSS max-width in HTML emails.

In this article, we’ll look at how to set CSS max-width in HTML emails.

How to set CSS max-width in HTML emails?

To set CSS max-width in HTML emails, we use table layout.

For instance, we write

<table border="0" cellspacing="0" width="100%">
  <tr>
    <td></td>
    <td width="350">
      The width of this cell should be a maximum of 350 pixels, but shrink to
      widths less than 350 pixels.
    </td>
    <td></td>
  </tr>
</table>

to set the td’s width to 350px.

And we make the table’s width 100% so that it fills the width of the window.

The td will shrink to fit the window.

Conclusion

To set CSS max-width in HTML emails, we use table layout.

Leave a Reply

Your email address will not be published.