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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With