Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons

© 2026 BraveProgrammer. All rights reserved.

  1. Courses
  2. /
  3. CSS Course

Lesson 37 of 50 · css

CSS for Email

Duration: 10 mins

Email clients support a limited subset of CSS. Follow these rules:

  • Use inline styles for maximum compatibility.
  • Avoid position, float, flex, grid (most clients strip them).
  • Use tables for layout, but you can still apply simple text styles.
  • Include a plain‑text fallback (multipart/alternative).

Example: Simple promotional email

<table width="100%" cellpadding="0" cellspacing="0" border="0" style="font-family:Arial,sans-serif;">
  <tr><td style="background:#0066cc; padding:20px; text-align:center; color:#fff;">
    <h1 style="margin:0; font-size:24px;">Special Offer</h1>
  </td></tr>
  <tr><td style="padding:20px;">
    <p>Get 30% off your first purchase.</p>
    <a href="#" style="display:inline-block; background:#ff6600; color:#fff; padding:10px 20px; text-decoration:none;">Shop Now</a>
  </td></tr>
</table>
Previous: Print StylesheetsNext: CSS Performance – Critical CSS & Unused CSS