About This HTML Issue
A # character inside the fragment portion of a URL is not valid and must be percent-encoded as %23.
The fragment identifier in a URL is everything after the first # character. Because # itself is the delimiter that starts the fragment, any additional # characters within the fragment are illegal according to RFC 3986. Browsers may handle these gracefully, but the markup is technically invalid.
This commonly happens when an id value on the target element contains a #, or when a URL is copied from somewhere and pasted without encoding. The fix is to replace any extra # inside the href fragment with %23. Better yet, avoid using # in id values altogether.
Invalid example
<a href="#section#2">Go to section</a>
The fragment section#2 contains a second #, which is not allowed.
Fixed example
Option 1: percent-encode the # inside the fragment.
<a href="#section%232">Go to section</a>
Option 2 (preferred): change the target id so it does not contain # at all.
<h2 id="section-2">Section 2</h2>
<a href="#section-2">Go to section</a>
Find issues like this automatically
Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.