Inline css html email template
Here is an example of an HTML email template with inline CSS:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Email Template</title>
<style>
/* Add your global styles here */
</style>
</head>
<body style="font-family: Arial, sans-serif; margin: 0; padding: 0;">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="center" style="background-color: #f2f2f2; padding: 20px;">
<h1 style="color: #333; font-size: 24px; margin-top: 0;">Email Template</h1>
<p style="color: #666; font-size: 16px; margin-bottom: 20px;">This is an example email template.</p>
<a href="#" style="background-color: #4CAF50; color: #fff; padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer;">Learn More</a>
</td>
</tr>
</table>
</body>
</html>
In this example, the HTML email template uses a table structure to layout the content. The style
attribute is used to add inline CSS styles to the HTML elements.
Here are some key things to note:
- The
style
attribute is used to add inline styles to individual HTML elements. - The
!important
keyword is not used in this example, as it can cause conflicts with other styles. - The
background-color
property is used to set the background color of the table cell. - The
padding
property is used to add padding to the table cell. - The
font-family
property is used to set the font family for the entire email. - The
margin
andpadding
properties are used to add spacing between elements.
You can customize this template by adding your own styles and content. Keep in mind that email clients may render the email differently, so it's a good idea to test your email template in different email clients and devices.
Here are some best practices to keep in mind when creating an HTML email template:
- Use a table structure to layout the content.
- Use the
style
attribute to add inline styles to individual HTML elements. - Avoid using external stylesheets or JavaScript files.
- Use a consistent font family and font size throughout the email.
- Use a clear and concise subject line and preheader.
- Test your email template in different email clients and devices.