You are able to add snippets of HTML code into your email using the HTML block. This guide is going to review the type of code the HTML block accepts.
Note that the following HTML tags will be removed for compatibility:
- Comments
- Input, Select, Button and Textarea Elements
- Forms
- JavaScript
- Embedded Videos
There are a few different versions of HTML. The common version these days is HTML5. XHTML is a "strictly" written language, which leaves less room for mistakes.
The Email Builder itself renders in HTML5, but the final sent email or when looking at the preview, the email will render in XHTML. Therefore, the HTML block is really an XHTML block.
All XML Elements Must
- XHTML Elements Must Always Be Closed
- Empty Elements Must Also Be Closed
- XHTML Elements Must Be In Lower Case
- XHTML Attribute Names Must Be In Lower Case
- XML tags are case sensitive. The tag <Letter> is different from the tag <letter>
XML Elements Must be Properly Nested
In HTML, you might see improperly nested elements:
<b><i> This text is bold and italic </b></i>
In XML, all elements must be properly nested within each other:
<b><i> This text is bold and italic </i> </b>
In the example above, "Properly nested" simply means that since the <i> element is opened inside the <b> element, it must be closed inside the <b> element.
Another example is, instead of doing something like:
<img src="w3schools.com/images/w3schools_green.jpg" alt="image">
You would need to actually close the tag as with a /
<img src="w3schools.com/images/w3schools_green.jpg" alt="image"/>
There are five pre-defined entity references in XML:
< | < | less than |
> | > | greater than |
& | & | ampersand |
' | ' | apostrophe |
" | " | quotation mark |
Only < and & are strictly illegal in XML, but it is a good habit to replace > with > as well.
White-space is Preserved in XML
XML does not truncate multiple white-spaces (HTML truncates multiple white-spaces to one single white-space):
XML: | Hello Tove |
HTML: | Hello Tove |
Source: https://www.w3schools.com/xml/xml_syntax.asp
HTML To XHTML Code Converter:
http://www.csgnetwork.com/cvthtml2xhtml.html
http://www.cruto.com/resources/code-generators/code-converters/html-to-xhtml.asp
Any links we provide from non-Keap sites or information about non-Keap products or services are provided as a courtesy and should not be construed as an endorsement by Keap.