Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there universal support for a span element inside an html email template?

Is it safe to use the span element inside a table i.e. inside a td element ?

I understand writing html based email templates can be a very tricky process especially when you have to account for all the different email clients and different levels of support. The general rule of thumb is to wrap all content inside nested tables.

I understand that elements such as div, section, article, p do not play nicely across all email clients.

like image 903
Alex P Avatar asked Dec 04 '15 17:12

Alex P


1 Answers

Span still has a place in HTML email development. It cannot be used in any way for display or height/width, but instead only for font styling and content manipulation.

For instance it can be used to increase or decrease the font, change font color, line-height, etc. on specific parts. (but keep in mind it will not break the line as a DIV will as it is not a block element).

Another useful aspect to span is to wrap it around images to style your ALT text.

What I find to be the most useful aspect is for hiding/showing content via media queries.

I am sure there are other uses, but always test in all email environments as support is inconsistent at best - similar to the DIV tag.

like image 196
Gortonington Avatar answered Sep 22 '22 00:09

Gortonington