Skip to main content

HTML Guide

Bad value X for attribute “href” on element “a”: Illegal character in fragment: “>” is not allowed.

The href attribute in the a tag uses an invalid character, as > is not allowed in URL fragments.

According to the HTML standard and URL syntax, fragment identifiers (the part after #) can only contain certain characters. The > character is not permitted and must be removed or percent-encoded. If the > is unintentional, simply omit it; if it must be included as part of the fragment, encode it as %3E.

Original HTML (invalid):

<a href="/page.php>">Read more</a>

Corrected HTML (if > should not be present):

<a href="/page.php">Read more</a>

Corrected HTML (if > is required in fragment, encode it):

<a href="/page.php%3E">Read more</a>

Learn more:

Related W3C validator issues