The HTML validator looks at the page's Doc Type, usually the very first line of code in the page's HTML.The Doc Type is a statement of which standard the document is supposedly following.I think it's important to point out when you say that you need to encode '&' characters in a HTML link attribute (<a href="">) that you are referring only to the ampersands of the URI syntax, not those found in the link (which must be percent-encoded).Your example is absolutely correct, but I thought I'd clarify it with another. l=1&q=rock&roll">awesome music</a> This example has two ampersands in it.
The HTML validator and the CSS validator differ in this respect.Any ampersand in the text itself, such as "rock&roll", should always be percent-encoded, not HTML-escaped. This ampersand is part of the URI syntax and so when you put the URI into the HTML link, it is still a bare ampersand which needs to be escaped. Only the URI-syntax ampersands should be HTML-escaped.This is then used to construct the full URL, " An often used validator is the World Wide Web Consortium's HTML Validator.It's provided by the same people who are responsible for the HTML specification, and more importantly most of its error messages provide a link to an explanation of what the error means.