CDATA Section Examples
Examples of CDATA sections in HTML 5
CDATA in HTML title
<title>A Tutorial: <![CDATA[<!-- HTML Comments -->]]></title>
Use a CDATA section to escape text containing the comment delimiters (<!--
) in text content so that it appears for all browsers. Otherwise comments should not be coded inside a <title>
tag. (See the issues with HTML 5 comments.)
CDATA with ]]>
<![CDATA[... ]]]><![CDATA[]> ...]]> <![CDATA[... ]]]]><![CDATA[> ...]]>
Since the characters ]]>
terminate a CDATA section, those characters must be split into two different CDATA sections.