Q:

Html code validation problems

I am facing problem with html code validation. My code is like:
 `<!DOCTYPE html>
    <html lang="en">
       <head>
         <meta charset="utf-8">

           <!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame
         Remove this if you use the .htaccess -->
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
     </head>

     <body>
        <!---this is a comment----->
    </body>
</html>`

It shows me an error. The error code is :

Consecutive hyphens did not terminate a comment. -- is not permitted inside a comment, but e.g. - - is.

what was the problem in my comment?? Please help

A:

When you have multiple dashes, this causes the HTML parser to think that the comment has ended, so it starts looking for a > which it cannot find.
So, when using comments, just use two dashed before and after, and never use two dashes in a row in the comment text itself.
This is formally not allowed, according to the specs:

4.7. Comments # T 
Comments consist of the following parts, in exactly the following order:

the comment start delimiter "<!--" 
text
the comment end delimiter "-->"

The text part of comments has the following restrictions:

must not start with a ">" character 
must not start with the string "->" 
must not contain the string "--"
must not end with a "-" character

The following is an example of a comment. 
<!-- main content starts here -->

Your comment violates both the rules that I made bold.

