yegor256
yegor256

Reputation: 105210

How to use CDATA in html documents?

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?

Upvotes: 14

Views: 13585

Answers (1)

Quentin
Quentin

Reputation: 944550

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.

Upvotes: 14

Related Questions