List of supported CSS and HTML attributes
With SendPulse, you can add and edit your email templates using the HTML editor. In this article, we'll look at what HTML tags and CSS properties can be used in email templates.
Supported HTML Tags
The table lists the HTML tags you can use in your email templates.
Tag | Function | Attributes |
Template elements | ||
head |
Stores service information, such as styles or page title |
|
p |
Defines a paragraph |
|
span |
Defines an inline element |
|
h1 , h2 , h3 , h4 , h5 , h6 |
Define 1-6 level headings |
|
img |
Inserts an image |
|
a |
Adds a link |
|
hr |
Creates a horizontal line |
|
br |
Sets a line break |
|
Text formatting | ||
b , strong |
Makes a text bold |
|
i |
Italicizes a text |
|
u |
Underlines a text |
|
s , strike |
Applies the strikethrough formatting |
|
label |
Specifies a text label for the input tag |
|
font |
Specifies font styles |
|
small |
Decreases the font size by one compared to plain text |
|
List | ||
li |
Creates a list item |
|
ol |
Creates a numbered (ordered) list |
|
ul |
Creates a bulleted (unordered) list |
|
Table | ||
table |
Creates a table |
|
tr |
Defines a table row |
|
td |
Defines a table cell |
|
th |
Defines a table header cell |
|
Some email clients use their own style sets, so we recommend using the standard attributes for the <table>
, <tr>
, <td>
, and <th>
tags.
Supported CSS Properties
Note that all properties must be written inline using the style
attribute.
Property | Function |
Background | |
background |
Sets the background style properties |
background-color |
Sets the background color |
Borders | |
border |
Sets all border style properties at once |
border-color |
Sets the border color |
border-width |
Sets the width of all borders |
border-style |
Sets the line style for all borders |
border-bottom |
Sets all style properties of the bottom border at once |
border-bottom-color |
Sets the bottom border color |
border-bottom-style |
Sets the bottom border line style |
border-bottom-width |
Sets the bottom border line width |
border-left |
Sets all style properties of the left border at once |
border-left-color |
Sets the left border color |
border-left-style |
Sets the left border line style |
border-left-width |
Sets the left border line width |
border-right |
Sets all style properties of the right border at once |
border-right-color |
Sets the right border color |
border-right-style |
Sets the right border line style |
border-right-width |
Sets the right border line width |
border-top |
Sets all style properties of the top border at once |
border-top-color |
Sets the top border color |
border-top-style |
Sets the top border line style |
border-top-width |
Sets the top border line width |
Element | |
display |
Specifies the element output and visual display on the page |
height |
Sets the element height |
width |
Sets the element width |
Font | |
color |
Sets the text color |
font |
Sets all font style properties at once |
font-family |
Sets the text font family |
font-size |
Sets the font size |
font-style |
Sets the font style, for example, normal or italic |
font-variant |
Determines how lowercase letters should be represented, i.e., whether to leave them unmodified (normal ) or apply small caps (small-caps ) |
font-weight |
Sets the font weight |
List | |
list-style-type |
Sets the marker type for each list element |
Table | |
table-layout |
Sets the width of the table cells based on the content |
Text | |
letter-spacing |
Sets the letter spacing in text |
line-height |
Sets the line spacing in text |
text-align |
Sets the horizontal text alignment |
text-decoration |
Specifies the text decoration, such as underlining, strikethrough, or blinking |
text-indent |
Sets the indent size before a line in a text block |
text-transform |
Converts text to uppercase or lowercase characters, for example, turns all characters in the text or the first character of every word in a sentence to uppercase |
vertical-align |
Sets the vertical text alignment |
For the <table>
, <tr>
, <td>
, and <th>
tags, we recommend duplicating the style
styles with the appropriate attributes. In the example below, in addition to the style
styles, the align
, width
, bgcolor
, cellpadding
, cellspacing
, and border
attributes are specified.
<table align="center" width="100%" bgcolor="#ffffff" cellpadding="0" cellspacing="0" border="0" style="background-color: #ffffff; width: 100%; max-width: 600px; margin: 0px auto; padding: 0px; border-collapse: collapse; border-spacing: 0; border: 0 none;">
Inserting a background image
You can insert a background image in the HTML editor like in example bellow:
<td style=" background-image: url('//www.spcdn.org/title-green-bck.png')" />
If you need to set additional options, such as indentation and alignment, use this example:
<tr style=" background-image: url('//www.spcdn.org/title-green-bck.png'); padding:0; text-align:center; vertical-align:top">
Where url('//www.spcdn.org/title-green-bck.png')
is a path to your image.
Last Updated: 09.09.2024
or