<br> tags.
Here’s how easy it is to create simple yet reliable spacers for your emails, using basic HTML and Tailwind CSS utility classes.
Div
The simplest vertical spacer for HTML emails:emails/example.html
leading-4sets the spacer’s height withline-height: 16px;role="separator"indicates the element is a divider, improving accessibility‍adds ‘content’ inside, so that the<div>can take up height
sm: screen variant:
emails/example.html
Responsive heights will only work in email clients that support
@media queries.div spacer is also available as a component.
Row
Need to add space between<table> rows?
emails/example.html
<tr> is row, so we use role="separator" to indicate that this is a separator, not a table row.
Semantic
We can use an<hr> to create a semantic Spacer.
emails/example.html
- we hide the line by resetting the border
- we give it the same color as the background of the page (for Outlook)
- we control the height with top and bottom margins
min-h-full class is used for compatibility with Apple email clients.