Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use CDATA in html documents?

Tags:

html

What is wrong with my HTML document?

<html>
  <body>
    <p><![CDATA[I can't see this text :(]]></p>
  </body>
</html>

Why don't I see the text inside CDATA?

like image 612
yegor256 Avatar asked Oct 07 '10 10:10

yegor256


1 Answers

Explicit CDATA sections are, in practice, unsupported in text/html documents. They are marked as a feature authors should avoid because they have limited support.

Your browser is probably treating it as an unknown element.

like image 100
Quentin Avatar answered Oct 10 '22 21:10

Quentin