logo rip
RIP Tutorial
  • Tags
  • Topics
  • Examples
  • eBooks
Download email (PDF)

email

  • Getting started with email
  • Bulletproof Buttons
  • CSS/HTML Support
  • HTML email composition and Outlook intricacies
  • HTML Email Reset
    • Resetting Email CSS in

Example

CSS resets for email are either general resets or client-specific resets. General resets give all email clients and browsers a common base to work on. Client-specific resets target some of the quirks inherent in select email clients.

A CSS reset like the one below can be placed in an email's <style> tag and does not have to be inlined.

<!DOCTYPE html>
<html lang="en">
    <head>
    <meta charset="UTF-8">
        <title>Hello!</title>

        <style>
            /* Remove spaces around the email design added by some email clients. */
            html,
            body {
                margin: 0 auto !important;
                padding: 0 !important;
                height: 100% !important;
                width: 100% !important;
            }
            
            /* Stops email clients resizing small text. */
            * {
                -ms-text-size-adjust: 100%;
                -webkit-text-size-adjust: 100%;
            }
            
            /* What is does: Centers email on Android 4.4 */
            div[style*="margin: 16px 0"] {
                margin:0 !important;
            }
            
            /* Stops Outlook from adding extra spacing to tables. */
            table,
            td {
                mso-table-lspace: 0pt !important;
                mso-table-rspace: 0pt !important;
            }
                    
            /* Fixes webkit padding issue. Fix for Yahoo mail table alignment bug. Applies table-layout to the first 2 tables then removes for anything nested deeper. */
            table {
                border-spacing: 0 !important;
                border-collapse: collapse !important;
                table-layout: fixed !important;
                margin: 0 auto !important;
            }
            table table table {
                table-layout: auto; 
            }
            
            /* Uses a better rendering method when resizing images in IE. */
            img {
                -ms-interpolation-mode:bicubic;
            }
            
            /* A work-around for iOS meddling in triggered links. */
            .mobile-link--footer a,
            a[x-apple-data-detectors] {
                color:inherit !important;
                text-decoration: underline !important;
            }

        </style>

    </head>
    <body>
        <!-- Email Content -->
    </body>
</html>


Got any email Question?


pdf PDF - Download email for free


Previous Next



This modified text is an extract of the original Stack Overflow Documentation created by following contributors and released under CC BY-SA 3.0
This website is not affiliated with Stack Overflow

logo rip
SUPPORT & PARTNERS
  • Advertise with us
  • Contact us
  • Cookie Policy
  • Privacy Policy
STAY CONNECTED

Get monthly updates about new articles, cheatsheets, and tricks.


Cookie
This website stores cookies on your computer.
We use cookies to enhance your experience on our website and deliver personalized content.
For more details on our cookie usage, please review our Cookie Policy and Privacy Policy

Leave this website