Skip to main content
HTML Validation

The element “a” with the attribute “href” must not appear as a descendant of the “a” element.

About This HTML Issue

An <a> element with an href attribute is interactive content, and interactive content cannot appear inside another <a> element.

The href attribute is what triggers this error. A link that points somewhere is interactive, and the HTML specification does not allow one interactive element to contain another. The outer <a> is already interactive, so a second linked <a> nested anywhere inside it, even several elements deep, makes the markup invalid. An <a> without href is just a placeholder and is allowed inside a link, which is why the validator names the attribute explicitly.

When links overlap like this, browsers cannot tell which destination a click should follow, and most will silently close the outer link before the inner one, producing a DOM that no longer matches your source. Screen readers run into the same ambiguity and may announce the wrong link or skip one entirely.

The fix is to give each link its own space so that no <a href> sits inside another <a href>.

Invalid example

<a href="/products">
  Browse our <a href="/products/new">new arrivals</a> today
</a>

Valid example

<p>
  <a href="/products">Browse our products</a> or check out our
  <a href="/products/new">new arrivals</a> today.
</p>

Find issues like this automatically

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

Help us improve our guides

Was this guide helpful?
🌍 Trusted by teams worldwide

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.

Scheduled Reports
API Access
Open Source Standards
$7 / 7 days

Pro Trial

Full Pro access. Cancel anytime.

Start Pro Trial →

Join teams across 40+ countries