W3 : character data is not allowed here html validation error

Error: Line 144, Column 6: character data is not allowed here

<div id="mydiv"></a>

This is the most common error message that once may receive while trying to validate their HTML page. The reasons that may cause this error,

  1. There might be some character's in your code that is not allowed.
  2. You might have some text in your html body that is not a part of any of the tags like div,span, p or any other.
  3. You might have forget to surround an attribute value with single or double quotes.
  4. If you are using HTML 4.01 doctype, make sure that you do not have any self closing tabs (/>) if yes then
  5. remove those slashes.

Note : Sometimes some unwanted characters may get added to your file (copy + paste file format issues) that may cause this issue, in such a case you must check that the file encoding format is UTF-8, if not just do that using Text-Editors like Notepad++ or SublimeText.

Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap