Changes in HTML 5 - <title> Tag
What's new in HTML 5
Differences between HTML 5 and earlier versions of HTML
The 2000-2010 Recommendations from the W3C HTML Working Group defined the HTML namespace for the title element type name along with the names of all HTML element types. In older (pre-2000) versions of HTML, element type names were not associated with a namespace.
Issues with HTML comments in the <title> tag
When HTML comment code appears inside a <title>
tag, where text content is expected, whether or not it is treated as comments depends on how the HTML document is being parsed. When it is being parsed as legacy HTML (for example, by IE 8 and some search engine crawlers), the code will be included in the text content. When the HTML document is being parsed as either xHTML, the XML serialization of HTML, or pure XML, the code will be treated as comments and will not appear in the displayed text. To avoid this, do not code comments in the <title>
tag or other text content.
To escape text containing the comment delimiters (<!--
) in text content so that it appears for all browsers, use a <![CDATA[...]]>
section instead.