Skip to main content
HTML Validation

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

About This HTML Issue

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.

Last reviewed: August 07, 2025

Was this guide helpful?

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Ready to validate your sites?
Start your free trial today.