Anchors must only be used as links with valid URLs or URL fragments

Log in (Premium content) Request a demo

Rule Description

Anchor links must be used with valid URLs or URL fragments so that they are discernible by a screen reader.

The Algorithm, in Simple Terms

Ensures that every anchor link is used as a link with a valid URL or URL fragment

Why this is Important

Inaccessible link elements pose great barriers to accessibility, as they are a fundamental component of a website.

Users who rely exclusively on a keyboard (and no mouse) to navigate a webpage can only click on links that can receive programmatic focus. If a link cannot receive programmatic focus, it will be inaccessible to these users.

How to Fix the Problem

Provide a valid link destination in the href attribute to ensure that links function properly even with JavaScript turned off. In particular, you should avoid href="" or href="rules/axe/3.0#". The "#" symbol is used as a "fragment identifier separator", which means its intended purpose within the href attribute is to precede a string of text which identifies a fragment within the page (a named anchor or an ID on the page). The use of "#" as the hypertext reference essentially means that the anchor points to nothing. In some browsers this may "point" to the entire document or to the top of the page, and this will cause an unexpected shift in focus.

Compliance Data & User Impact

User Impact: Serious
Disabilities Affected:
  • Blindness
  • Deafblindness
  • Mobility/Dexterity
Issue Type:
  • Deque Best Practice
WCAG Success Criteria:
  • Not applicable
Section 508 Guidelines:
  • Not applicable

Related Deque University Course Pages

Other Related Resources

Additional Information

Relevant Technologies:
  • HTML 4
  • HTML 5
Relevant Custom Widget Type(s):
  • Link (ARIA)
Test Reliability: Automated testing is possible, with high accuracy
Rule ID: href-no-hash