To get the best results when you work with CSS in HTML email, keep your code simple and inline your CSS. Mailchimp's Automatic CSS Inliner tool converts styles from your pasted code to inline and saves you from coding it by hand.
In this article, you'll learn how to turn on the Automatic CSS Inliner in a Code your own template, and which selectors are supported.
Turn on the Inliner
To turn on the CSS inliner in a Code your own template, follow these steps.
In the Content section of the email checklist, click Design Email.
On the template step, click the Code your own tab and select Paste in code. If you’re using the new builder, click Yes, continue to Classic in the popup modal.
On the Code step, paste in your HTML code.
Click the Settings tab.
Check the box next to Automatic CSS Inliner.
Selectors supported by the CSS Inliner
Use the Automatic CSS Inliner to include sophisticated CSS styling in your HTML email, including attributes, pseudo-classes, descendants, and more. These selectors are supported by the Inliner.
tagname
class
has attribute
attribute value equals
attribute value is one of
attribute value contains
attribute hyphen value
attribute value begins with
attribute value ends with
pseudo-classes first-child
last-child
only-child
empty
not
nth-child
child
descendant
sibling
After you've turned on the Inliner and the rest of your code is ready to go, continue setting up your email.
Note
When you enable the Inliner option, you won't see an immediate change to your code. After your message is sent to the queue, we'll convert the styles before we deliver it to your audience. However, you can preview the email in a side-by-side viewer and verify our changes are good before you send.
The Inliner doesn't "fix" CSS support issues, only those that are safe to use in bulk email. For example, you still shouldn't use DIV tags to position your content.
Technical Support
Have a question?
Paid users can log in to access email and chat support.
Learn about HTML email and get tips on how to design your HTML email.
Mailchimp uses cookies for our website to function properly; some are optional and help deliver a personalized and enhanced experience. By clicking “Dismiss”, you consent to store cookies on your device in accordance with our cookie statement. We may collect anonymized data from your browser independent of your cookie preferences. Preferences can be updated at any time.Cookie Statement.
Mailchimp Sites may request cookies to be set on your device. We use cookies to let us know when you visit our Mailchimp Sites, to understand how you interact with us, to enrich and personalize your user experience, to enable social media functionality and to customize your relationship with Mailchimp, including providing you with more relevant advertising. Click on the different category headings to find out more. You can also change your cookie preferences at any time. Note that blocking some types of cookies may impact your experience on our Mailchimp Sites and the services we are able to offer.
More information
Manage Consent Preferences
Essential Website Cookies
Always Active
These cookies are strictly necessary to provide you with the services and features available through our site. Because these cookies are strictly necessary to deliver the site, you cannot refuse them without impacting how the site functions.
Performance and Functionality Cookies
These cookies are used to enhance the functionality and performance of the site. They help us to customize the site and application for you in order to enhance your experience. While these cookies are not needed for a basic website experience, certain functionalities such as personalization and video would become unavailable.
Advertising (Targeting) Cookies
These cookies are used to make advertising messages more relevant to you and your interests. They also perform functions like preventing the same ad from continuously reappearing, ensuring that ads are properly displayed, and in some cases selecting advertisements that are based on your interests.
Analytics and Customization Cookies
These cookies collect information to help us understand how the site is being used or how effective our marketing campaigns are. They help us to know which pages are the most and least popular and to see how visitors move around the site. These cookies may be set by us or by third-party providers whose services we have added to our pages.