Skip to main content

HTML Guide

Bad value X for attribute “href” on element “a”: Backslash ("") used as path segment delimiter.

Backslashes (\) are not allowed in href values; use forward slashes (/) to separate path segments in URLs.

The href attribute in the a (anchor) element defines the hyperlink target and must contain a valid URL. According to the WHATWG HTML Standard, URL paths must use forward slashes (/) as delimiters, not backslashes (\). Backslashes are not recognized by web browsers as valid path separators and will cause validation errors or unexpected behavior. This issue often occurs when copying Windows file paths, which use backslashes, into HTML.

Incorrect HTML:

<a href="folder\page.html">Link</a>

Correct HTML:

<a href="folder/page.html">Link</a>

If you need to link to a file or resource, always replace any backslashes with forward slashes for proper HTML and browser compatibility.

Learn more:

Related W3C validator issues