Validator, </a> tag: "End tag a violates nesting rules"

css validator
validator - npm
html validator chrome
html validator online
dom validator
w3c validator seo
ws validator
cass validator

I ran my website in the w3 validator and got this error...

Line 16, Column 4: End tag a violates nesting rules.

</a>

What is the problem? I worked hard to write good markup and only got 2 errors, the other error I fixed, but this one I just can't work out...

It means that you have mis-matched tags.

For example, the following code will throw the error described:

<a href=''><b>Some text</a></b>

Given that you made a point to state that you'd tried to write good markup and that you don't have any other errors, I guess you know that already, so what could be causing it.

My guess is that you've got a tag which isn't being closed properly inside your <a> tag.

For example, in the example I gave above, you might have the closing </b> tag in the right place, but maybe have a typo with it that stops it being recognised as a closing tag - eg maybe missing the slash? That would be the most plausible, and easy to miss.

Or another example -- maybe you've got code like this:

<a href=''><img src='pic.jpg'></a>

In an HTML document, the above code is perfectly valid. However, if you've specified your <DOCTYPE> as xhtml it is invalid, because in xhtml all tags need to be closed, and the <img> above isn't. It would need a closing slash added to it like this:

<a href=''><img src='pic.jpg' /></a>

My guess is that your error is something along these lines.

You haven't shown us the code that is generating the errors, so I'm shooting in the dark a bit here, but that is my guess.

I would also say that while the W3C's validator is an excellent resource, if you're using a decent IDE to write your code, the code editor should highlight any syntax errors like this for you while you're writing the code. That would make it very easy to see the problem. Even some browsers' View Source feature will show you syntax highlighting which may reveal the problem.

Validator, verb (used with object), val·i·dat·ed, val·i·dat·ing. to make valid; substantiate; confirm: Time validated our suspicions. to give legal force to; legalize. to give official sanction, confirmation, or approval to, as elected officials, election procedures, documents, etc.: to validate a passport. to give legal force to; legalize. to give official sanction, confirmation, or approval to, as elected officials, election procedures, documents, etc.: to validate a passport.

A bit late but can be useful for others !! In the "nesting rules" you can't open a tag and then open another tag in it but closing it outside the first tag!! hahaha sound not so clear!! An example is better than thousand words, so:

This will give you a nesting rules error !!

...blabla <em><b>blibloblu</em></b> blablabla....

While this is correct !!

...blabla <em><b>blibloblu</b></em> blablabla....

Hopefully that will help some !!

W3C Markup Validation Service, is an important step towards ensuring the technical quality of web pages. Validatory definition is - of or relating to validation. Love words? You must — there are over 200,000 words in our free online dictionary, but you are looking for one that’s only in the Merriam-Webster Unabridged Dictionary.

If possible please share your code. I think you are using a tag under a tag. You have to use single a tag.

<a href="">
    <ul>
        <li><a href="">A</a></li>
        <li><a href="">B</a></li>
    </ul>
</a>

validator, Get unlimited public & private packages + package-based permissions with npm Pro.Get started ». validator. 13.0.0 • Public • Published a  Definition, Synonyms, Translations of validatory by The Free Dictionary

Validator, A validator is a computer program used to check the validity or syntactical correctness of a fragment of code or document. The term is commonly used in the​  JSONLint is a validator and reformatter for JSON, a lightweight data-interchange format. Copy and paste, directly type, or input a URL in the editor above and let JSONLint tidy and validate your messy JSON code.

Validator.nu (X)HTML5 Validator, Validator definition, to make valid; substantiate; confirm: Time validated our suspicions. See more. Free phone number validation provided by PhoneValidator.com. Check phone numbers to verify if they are cell phones or landlines. Works with all U.S. phone numbers.

Validator.nu, Validator.nu (X)HTML5 Validator (Living Validator). Validator Input. Address, File Upload, Text Field. Show Image Report. Show Source. About this Service  confirm, corroborate, substantiate, verify, authenticate, validate mean to attest to the truth or validity of something. confirm implies the removing of doubts by an authoritative statement or indisputable fact. confirmed the reports corroborate suggests the strengthening of what is already partly established.

Comments
  • Can you provide more code?
  • Without seeing the rest of the markup... It may mean that you are closing an </a> without an opening it, or that it is in an illegal place (inside an element it is not allowed to be in).
  • Check for instance stackoverflow.com/questions/14003588/html-invalid-validation; most likely you have a miss placed tag.
  • It also helps if you inform us what doctype your using. HTML5? XHTML? etc. Different rules apply to different doctypes.