Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Coding Mobile First Emails That Work Everywhere

Avatar for Chris Smith Chris Smith
September 18, 2018

Coding Mobile First Emails That Work Everywhere

You know that feeling you get when you look at your beautifully coded email on an iPhone? How does it compare to the one you get when looking at the same email in the Gmail App? By coding mobile first, you can handle the challenges that different email clients and devices pose, ensuring your emails look great and function properly in even the trickiest inboxes.

Avatar for Chris Smith

Chris Smith

September 18, 2018
Tweet

More Decks by Chris Smith

Other Decks in Programming

Transcript

  1. The Top 10 LEVEL 1 #1 Apple iPhone #2 Gmail

    #3 Yahoo! Mail #4 Apple iPad #5 Outlook #6 Apple Mail #7 Outlook.com #8 Samsung Mail #9 Google Android #10 Windows Live Mail 1
  2. Most Difficult LEVEL 3 Comcast GMX.de IBM Notes 9 Libero

    Lotus Notes 8-8.5 Mail.ru Orange.fr T-Online.de Web.de 3
  3. #LitmusLive | @chrismith77 !important AVOID <head> <style> .class { …

    !important; } </style> <style> @media { … !important; } </style> </head>
  4. #LitmusLive | @chrismith77 Of Gmail IMAP AKA GANGA (Gmail App

    with a Non Gmail Account) BECAUSE <style> .class { … } </style>
  5. #LitmusLive | @chrismith77 FONT – SIZE CHANGE <table> <tr> <td

    style="font-size: 16px;"> <h1 style="font-size: 25px;"> <span class="headline"> … </span> </h1> <p class="text" style="…"> … </p> </td> HTML Structure
  6. #LitmusLive | @chrismith77 FONT – SIZE CHANGE <table> <tr> <td

    style="font-size: 16px;"> <h1 style="font-size: 25px;"> <span class="headline"> … </span> </h1> <p class="text" style="…"> … </p> </td> HTML Structure
  7. #LitmusLive | @chrismith77 Desktop Styles FONT – SIZE CHANGE <style>

    .headline { font-size: 55px; } .text { font-size: 22px; } … styles cont.
  8. #LitmusLive | @chrismith77 Media Query Reset FONT – SIZE CHANGE

    @media screen and (max-width: 599px) { .headline { font-size: 25px; } .text { font-size: 16px; } }
  9. #LitmusLive | @chrismith77 TEXT – ALIGNMENT CHANGE <table> <tr> <td

    class="text-wrapper" align="left"> <h1 style="…"> … </h1> <p style="…"> … </p> </td> </tr> HTML Structure
  10. #LitmusLive | @chrismith77 TEXT – ALIGNMENT CHANGE <table> <tr> <td

    class="text-wrapper" align="left"> <h1 style="…"> … </h1> <p style="…"> … </p> </td> </tr> HTML Structure
  11. #LitmusLive | @chrismith77 Desktop Styles TEXT – ALIGNMENT CHANGE <style>

    .text-wrapper { text-align: center; } … styles cont.
  12. #LitmusLive | @chrismith77 Media Query Reset TEXT – ALIGNMENT CHANGE

    @media screen and (max-width: 599px) { .text-wrapper { text-align: left; } }
  13. #LitmusLive | @chrismith77 CONTAINER - SIDE PADDING CHANGE <table width="100%">

    <tr> <td align="center" style="padding: 0 20px;"> <table> <tr> <td style="width: 440px;"> … </td> </tr> </table> HTML Structure
  14. #LitmusLive | @chrismith77 CONTAINER - SIDE PADDING CHANGE <table width="100%">

    <tr> <td align="center" style="padding: 0 20px;"> <table> <tr> <td style="width: 440px;"> … </td> </tr> </table> HTML Structure
  15. Hybrid coding uses a mix of fluid tables and elements

    that are constrained on desktop with max-width and MSO conditional comments
  16. #LitmusLive | @chrismith77 HYBRID <table class="content-block-class"> <tr> <td class="stack-wrapper"> <!--[if

    true]> ... <![endif]--> <div class="column"> ... </div> <!--[if true]> ... <![endif]--> <div class="column"> ... </div> <!--[if true]> ... <![endif]--> HTML Structure
  17. #LitmusLive | @chrismith77 HYBRID <table class="content-block-class"> <tr> <td class="stack-wrapper"> <!--[if

    true]> ... <![endif]--> <div class="column"> ... </div> <!--[if true]> ... <![endif]--> <div class="column"> ... </div> <!--[if true]> ... <![endif]--> HTML Structure
  18. #LitmusLive | @chrismith77 Global Wrapper Styles HYBRID <style> .stack-wrapper {

    font-size: 0; text-align: center; } … styles cont.
  19. #LitmusLive | @chrismith77 Global Column Styles HYBRID .stack-wrapper .column {

    display: inline-block; vertical-align: top; width: 100%; } … styles cont.
  20. #LitmusLive | @chrismith77 Media Query Reset HYBRID @media screen and

    (max-width: 599px) { .three-column .column { margin: 0; max-width: 100%; } }
  21. Startup Tips MOBILE FIRST 1 2 3 4 5 Use

    analytics to help choose the right technique Multi-Column layouts still benefit from hybrid code Avoid the use of !important whenever possible Work with designers to standardize elements Don’t overdo it!