### Basic Email Button Styling Source: https://github.com/emailmonday/cerberus/blob/main/docs/content/components.md A simplified example of an email button with basic styling and hover effects. This is useful for quick implementation. ```html Button Text ``` -------------------------------- ### Change Text and Background Colors for Dark Mode Source: https://github.com/emailmonday/cerberus/blob/main/docs/content/dark-mode.md This example demonstrates changing text color and table cell background color for dark mode using CSS utility classes within a media query. ```html

Some text goes here.

``` -------------------------------- ### Less Than or Equal To Operator for Outlook Versions Source: https://github.com/emailmonday/cerberus/blob/main/docs/content/outlook.md Use the 'lte' operator to include content for Outlook versions less than or equal to a specified version. This example targets Outlook 2010 and below. ```html Outlook 2010 and below ``` -------------------------------- ### Less Than Operator for Outlook Versions Source: https://github.com/emailmonday/cerberus/blob/main/docs/content/outlook.md Use the 'lt' operator to include content for Outlook versions less than a specified version. This example targets versions below Outlook 2010. ```html Everything below Outlook 2010 ``` -------------------------------- ### OR Operator for Specific Outlook Versions Source: https://github.com/emailmonday/cerberus/blob/main/docs/content/outlook.md Use the 'or' operator ('|') to target specific Outlook versions. This example targets Outlook 2007 and Outlook 2016 only. ```html Outlook 2007 / 2016 only ``` -------------------------------- ### Greater Than or Equal To Operator for Outlook Versions Source: https://github.com/emailmonday/cerberus/blob/main/docs/content/outlook.md Use the 'gte' operator to include content for Outlook versions greater than or equal to a specified version. This example targets Outlook 2010 and above. ```html Outlook 2010 and above ``` -------------------------------- ### NOT Operator for Excluding Outlook Versions Source: https://github.com/emailmonday/cerberus/blob/main/docs/content/outlook.md Use the 'not' operator ('!') to exclude specific Outlook versions. This example targets all versions except Outlook, which will ignore the content. ```html All Outlooks will ignore this ``` -------------------------------- ### Greater Than Operator for Outlook Versions Source: https://github.com/emailmonday/cerberus/blob/main/docs/content/outlook.md Use the 'gt' operator to include content for Outlook versions greater than a specified version. This example targets versions above Outlook 2010. ```html Everything above Outlook 2010 ``` -------------------------------- ### Responsive and Static Images in HTML Source: https://github.com/emailmonday/cerberus/blob/main/docs/content/components.md Demonstrates how to code responsive and static images using the `` tag. Responsive images scale down, while static images maintain their original size. Ensure to use absolute HTTPS paths for image sources. ```html alt_text alt_text ``` -------------------------------- ### Responsive Stack Column Layout Source: https://github.com/emailmonday/cerberus/blob/main/cerberus-hybrid.html Utility classes to stack columns into full-width rows on smaller screens. `.stack-column-center` also centers the content within the stacked column. ```css @media screen and (max-width: 480px) { .stack-column, .stack-column-center { display: block !important; width: 100% !important; max-width: 100% !important; direction: ltr !important; } .stack-column-center { text-align: center !important; } } ``` -------------------------------- ### Email Client Style Resets and Fixes Source: https://github.com/emailmonday/cerberus/blob/main/cerberus-hybrid.html Applies essential resets and fixes for common email client rendering issues. Includes styles for viewport, text resizing, Outlook spacing, webkit padding, IE image rendering, link underlining, and Apple/Gmail specific behaviors. ```css :root { color-scheme: light dark; supported-color-schemes: light dark; } html, body { margin: 0 auto !important; padding: 0 !important; height: 100% !important; width: 100% !important; } * { -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; } div[style*="margin: 16px 0"] { margin: 0 !important; } #MessageViewBody, #MessageWebViewDiv{ width: 100% !important; } table, td { mso-table-lspace: 0pt !important; mso-table-rspace: 0pt !important; } table { border-spacing: 0 !important; border-collapse: collapse !important; table-layout: fixed !important; margin: 0 auto !important; } img { -ms-interpolation-mode:bicubic; } a { text-decoration: none; } a[x-apple-data-detectors], .unstyle-auto-detected-links a, .aBn { border-bottom: 0 !important; cursor: default !important; color: inherit !important; text-decoration: none !important; font-size: inherit !important; font-family: inherit !important; font-weight: inherit !important; line-height: inherit !important; } .im { color: inherit !important; } .a6S { display: none !important; opacity: 0.01 !important; } img.g-img + div { display: none !important; } ``` -------------------------------- ### Apply Dark Mode Styles with CSS Utility Classes Source: https://github.com/emailmonday/cerberus/blob/main/docs/content/dark-mode.md Use the `prefers-color-scheme: dark` media query to apply styles. Utility classes suffixed with `!important` override inline styles. ```html

Text that is black in light mode and white in dark mode.

``` -------------------------------- ### Hybrid Email Design with Ghost Tables Source: https://github.com/emailmonday/cerberus/blob/main/docs/content/hybrid-responsive.md This HTML snippet demonstrates a hybrid email design technique using MSO conditional comments and inline styles to create two columns that stack on mobile and display side-by-side on desktop. It's useful for achieving responsive layouts in email clients that don't fully support media queries. ```html ``` -------------------------------- ### Create Ghost Tables for Outlook Responsiveness Source: https://github.com/emailmonday/cerberus/blob/main/docs/content/outlook.md Implement 'ghost tables' using MSO conditional comments to ensure hybrid emails maintain a fixed width in Outlook, compensating for its lack of support for modern CSS properties like inline-block and max-width. ```html
Outlook can’t render the CSS in this DIV but other email clients can, so we wrap this in a ghost table that replicates the DIV’s desktop style. In this case, a container 340px wide.
``` -------------------------------- ### Centering Utility Class Source: https://github.com/emailmonday/cerberus/blob/main/cerberus-hybrid.html A generic utility class for centering elements like images, buttons, and nested tables on narrow screens. Apply `.center-on-narrow` to the element. ```css .center-on-narrow { text-align: center !important; display: block !important; margin-left: auto !important; margin-right: auto !important; float: none !important; } table.center-on-narrow { display: inline-block !important; } ``` -------------------------------- ### Create Email Button with HTML Source: https://github.com/emailmonday/cerberus/blob/main/docs/content/components.md Use this HTML structure to create a button that displays consistently across email clients. It includes styles for hover effects and dark mode. ```html
Primary Button
``` -------------------------------- ### Set Color Scheme for Email Clients Source: https://github.com/emailmonday/cerberus/blob/main/cerberus-fluid.html Provides email clients with information about supported color schemes. This is a duplicate of the meta color-scheme tag. ```css :root { color-scheme: light dark; supported-color-schemes: light dark; } ``` -------------------------------- ### HTML with VML for Background Images Source: https://github.com/emailmonday/cerberus/blob/main/docs/content/components.md This snippet demonstrates how to implement background images in HTML emails. It includes CSS for modern clients and VML for older versions of Outlook. Ensure background colors are set for accessibility when images are disabled. ```html
Foreground HTML content.
``` -------------------------------- ### Button Hover Styles Source: https://github.com/emailmonday/cerberus/blob/main/cerberus-hybrid.html Provides smooth transition effects for button hover states. Use `.button-td-primary` and `.button-a-primary` classes for primary buttons. ```css .button-td, .button-a { transition: all 100ms ease-in; } .button-td-primary:hover, .button-a-primary:hover { background: #555555 !important; border-color: #555555 !important; } ``` -------------------------------- ### Button Hover Styles Source: https://github.com/emailmonday/cerberus/blob/main/cerberus-fluid.html Provides smooth transition effects for button hover states, changing background and border colors. ```css .button-td, .button-a { transition: all 100ms ease-in; } .button-td-primary:hover, .button-a-primary:hover { background: #555555 !important; border-color: #555555 !important; } ``` -------------------------------- ### HTML Email Button Pattern Source: https://github.com/emailmonday/cerberus/blob/main/docs/templates/index.html A reusable HTML table structure for creating a button in an email. Includes inline styles for maximum compatibility and a hover/focus state with media query for dark mode support. ```html
Button Text
``` ```css .ex-button:hover, .ex-button:focus { background: #555555 !important; } @media (prefers-color-scheme: dark) { .ex-button { background: #ffffff !important; color: #222222 !important; } .ex-button:hover { background: #cccccc !important; } } ``` -------------------------------- ### Center Content on Narrow Screens Source: https://github.com/emailmonday/cerberus/blob/main/cerberus-responsive.html A utility class for centering elements like images, buttons, and nested tables on smaller screens. It ensures block display and auto margins. ```css .center-on-narrow { text-align: center !important; display: block !important; margin-left: auto !important; margin-right: auto !important; float: none !important; } table.center-on-narrow { display: inline-block !important; } ``` -------------------------------- ### Normalize Body and HTML Styles Source: https://github.com/emailmonday/cerberus/blob/main/cerberus-fluid.html Removes default spacing and ensures full height and width for email clients. Beware: this can affect padding/margin and background colors in reply windows. ```css html, body { margin: 0 auto !important; padding: 0 !important; height: 100% !important; width: 100% !important; } ``` -------------------------------- ### Fix Webkit Padding Issues and Table Layout Source: https://github.com/emailmonday/cerberus/blob/main/cerberus-responsive.html Applies consistent table layout and spacing, fixing padding issues in Webkit-based email clients. Ensures tables are centered. ```css table { border-spacing: 0 !important; border-collapse: collapse !important; table-layout: fixed !important; margin: 0 auto !important; } ``` -------------------------------- ### Setting Background Colors with Inline CSS Source: https://github.com/emailmonday/cerberus/blob/main/docs/content/components.md Applies a solid background color to a table using the `background-color` inline CSS property. This method offers more flexibility and is also well-supported. ```html
``` -------------------------------- ### Responsive Viewport Adjustments for iOS Source: https://github.com/emailmonday/cerberus/blob/main/cerberus-hybrid.html Media queries to adjust the minimum width of the email container for different iPhone viewports. Ensures proper rendering on various iPhone models. ```css @media only screen and (min-device-width: 320px) and (max-device-width: 374px) { u ~ div .email-container { min-width: 320px !important; } } @media only screen and (min-device-width: 375px) and (max-device-width: 413px) { u ~ div .email-container { min-width: 375px !important; } } @media only screen and (min-device-width: 414px) { u ~ div .email-container { min-width: 414px !important; } } ``` -------------------------------- ### Swap Images for Dark Mode Source: https://github.com/emailmonday/cerberus/blob/main/docs/content/dark-mode.md Include separate image files for light and dark modes, then use CSS with `prefers-color-scheme` to display the appropriate image. Outlook requires conditional comments to hide the dark mode image. ```html ``` -------------------------------- ### Improve Readability on Small Screens Source: https://github.com/emailmonday/cerberus/blob/main/cerberus-responsive.html Adjusts paragraph font size within the email container for better readability on small screens. ```css .email-container p { font-size: 17px !important; } ``` -------------------------------- ### Setting Background Colors with HTML Attributes Source: https://github.com/emailmonday/cerberus/blob/main/docs/content/components.md Applies a solid background color to a table using the `bgcolor` HTML attribute. This method is well-supported across email clients. ```html
``` -------------------------------- ### HTML Lists with Inline Styles Source: https://github.com/emailmonday/cerberus/blob/main/docs/content/components.md Structure content using unordered (`