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 you write one <a href> directly inside another, the HTML parser closes the outer link as soon as it reads the inner <a> tag, and the validator reports Start tag “a” seen but an element of the same type was already open instead. The error on this page appears only when the nesting survives parsing, for example when a link wraps a whole table that has links in its cells. The page then has a real link inside a link: browsers can't tell which destination a click should follow, and screen readers may announce the wrong link or skip one.

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/42">
  <table>
    <tr>
      <td>Trail running shoes</td>
      <td><a href="/reviews/42">Read reviews</a></td>
    </tr>
  </table>
</a>

Valid example

<table>
  <tr>
    <td><a href="/products/42">Trail running shoes</a></td>
    <td><a href="/reviews/42">Read reviews</a></td>
  </tr>
</table>

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
€5 / week

1K Weekly

1,000 monthly checks. Cancel anytime.

Get 1K Weekly →

Join teams across 40+ countries