Skip to main content

HTML Guide

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

Space characters are not allowed in href attributes. Instead, they should be converted to %20. In this example, the first line is invalid and the second is valid:

<a href="https://example.com#some term">invalid</a>
<a href="https://example.com#some%20term">valid</a>

Related W3C validator issues