SwitchUp SwitchUp Ranked Best Coding Bootcamps 2025

How to add css class name to email html templates

Altcademy Team wrote on 7 February 2018

would like to use classname property in html email templates

Answer
Currently this is not possible. You can only use inline styles.
What you can't do:
  • Include a <head> section with styles. Apple Mail.app supports it, but Gmail and Hotmail do not, so it's a no-no. Hotmail will support a style section in the body but Gmail still doesn't.
  • Link to an external stylesheet. Not many email clients support this, best to just forget it.
  • Background-image / Background-position. Gmail is also the culprit on this one.
  • Clear your floats. Gmail again.
  • Margin. Yep, seriously, Hotmail ignores margins. Basically any CSS positioning at all doesn't work.
  • Font-anything. Chances are Eudora will ignore anything you try to declare with fonts.
What you can do:
  • Inline styles like
<h3 style="color: #1c70db;">NOW $159</h3>

Trusted by

Students and instructors from world-class organizations

Join the upcoming Cohort #111

Enroll for March 2nd, 2026