Can comments in HTML contain special characters?

  • No, they cannot contain any special characters. 
  • Only if they are within a CDATA section. 
  • Yes, but they must be encoded. 
  • Yes, except for the sequence "--". 
HTML comments can contain special characters; however, they cannot include the character sequence "--" (double hyphen) as it signifies the end of the comment. Including "--" within a comment might cause the comment to terminate prematurely or result in a parsing error. 
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *