Is there an equivalent of CSS max-width that works in HTML emails?

后端 未结 5 1266
梦如初夏
梦如初夏 2020-12-07 08:12

I\'m trying to create an HTML email that will display properly in all widely used email clients. I\'m wrapping the whole email in a table, and I\'d like it to have a width

5条回答
  •  醉酒成梦
    2020-12-07 08:49

    The short answer: no.

    The long answer:

    Fixed formats work better for HTML emails. In my experience you're best off pretending it's 1999 when it comes to HTML emails. Be explicit and use HTML attributes (width="650") where ever possible in your table definitions, not CSS (style="width:650px"). Use fixed widths, no percentages. A table width of 650 pixels wide is a safe bet. Use inline CSS to set text properties.

    It's not a matter of what works in "HTML emails", but rather the plethora of email clients and their limited (and sometimes deliberately so in the case of Gmail, Hotmail etc) ability to render HTML.

提交回复
热议问题