HTML Guides for double slash
Learn how to identify and fix common HTML validation errors flagged by the W3C Validator — so your pages are standards-compliant and render correctly across every browser. Also check our Accessibility Guides.
A URL that starts with // needs a host name right after the two slashes, and this href has none.
An href such as //example.com/news is a scheme-relative URL. The browser keeps the scheme of the current page (http: or https:) and reads everything after the //, up to the next /, ? or #, as the host. In //?page=news, //#contact or a bare //, that part is empty. The URL Standard rejects a URL with no host, so the link has no valid destination.
The extra slash usually comes from a typo, or from a template that glued a base path ending in / onto a path starting with /. In that case the link was meant to be root-relative: /?page=news is the site's home page with a query string, and /#contact is an anchor on that page. Drop one slash and the error goes away. If the link goes to another site, put that site's host after the slashes, or write the full address, such as https://example.com/?page=news.
Invalid example
<nav>
<a href="//?page=news">News</a>
<a href="//#contact">Contact</a>
</nav>
Valid example
<nav>
<a href="/?page=news">News</a>
<a href="/#contact">Contact</a>
</nav>
Validate at scale.
Ship accessible websites, faster.
Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.
1K Weekly
1,000 monthly checks. Cancel anytime.
Get 1K Weekly →Join teams across 40+ countries