NeovaNền tảng SEO chuyên sâu

Thành phần điều khiển tương tác lồng trong một thành phần điều khiển khác

Trong Neova Chạy ngay từ lần crawl: không cần thiết lập gì.

Quy tắc được rà soát lần cuối ngày 17 tháng 10 năm 2026 · Hướng dẫn cập nhật ngày 2 tháng 7 năm 2026

WCAG 4.1.2 áp dụng ở đây. Trình đọc màn hình có thể không đọc lên thành phần điều khiển bên trong, nhưng nó vẫn nhận focus bàn phím, nên người dùng dừng ở một thứ không có tên hay role.

Bạn có thể làm gì

Di chuyển thành phần điều khiển bên trong ra ngoài phần tử cha của nó, để mỗi thành phần điều khiển đứng riêng.

Vì sao Neova đánh dấu

  • Thành phần điều khiển nằm trong một thành phần điều khiển khác, như button trong link, có thể không được trình đọc màn hình đọc.
  • Nó vẫn nhận focus bàn phím, nên người dùng rơi vào một thứ không có tên cũng không có role.
  • HTML không cho phép nội dung tương tác bên trong link và button, và WCAG 4.1.2 áp dụng.

Nguồn

Hướng dẫn đầy đủ

Phần này tạm thời còn bằng tiếng Anh.

Element Code: AC-033

TL;DR: An interactive element nested inside another interactive element, a button inside a link, a link inside a button, breaks keyboard access and screen reader announcements. Worse, nested anchors get silently split apart by the HTML parser, so the markup crawlers see is not the markup you wrote. Flatten it: one control per interaction.
Check
AC-033, Accessibility
Affects
Links, buttons, widgets
Severity
Serious (axe rating)
Detection
axe nested-interactive
Usual suspect
Card components

What Counts as a Nested Interactive Control

Any focusable, activatable element sitting inside another one: a <button> inside an <a>, an <a> inside a <button>, an anchor inside an anchor, a link inside a <summary>, form controls inside a clickable label that maps to a different control, or anything with tabindex="0" or an interactive ARIA role (button, link, checkbox, tab) placed inside an element that already has one. Axe flags all of these under its nested-interactive rule and rates the issue serious, and this check mirrors that logic.

The HTML spec is blunt about it: the content model for <a> and <button> forbids interactive content inside them. This is not a style preference, it is invalid markup with runtime consequences.

Why It Breaks Things

One tab stop, two actions. Keyboard users get a single focus stop where two behaviors live. Which one fires on Enter? Depends on the browser and the event wiring. Some inner controls become unreachable by keyboard entirely, which fails WCAG 2.1.1 (Keyboard).

Screen readers pick one name. Assistive technology has to compute a single role and name for the focused thing. A "Read more" link wrapping a card that also contains a "Save" button often gets announced as one link whose name is the entire card text, with the button never announced at all.

The parser rewrites nested anchors. This is the part with direct SEO teeth. Browsers cannot represent an <a> inside an <a>, so the HTML parser closes the first anchor the moment it meets the second. Your DOM ends up with two sibling links whose boundaries and anchor text are not what your template says. Googlebot renders pages with the same parsing rules, so link extraction and anchor text run against the mangled version. I have watched an "entire card is a link" template quietly turn its card titles into empty anchors this way, and nobody had looked at the rendered DOM in a year.

Before: nested controls <a href="https://example.com/product"> (card) <img> <h3> <button> Button trapped inside the link: one tab stop, two competing actions, screen reader announces the link only axe: nested-interactive (serious) Invalid per the HTML content model After: flattened structure <div class="card"> <a> title <img> <button> Link and button are siblings: two tab stops, each announced correctly, CSS stretches the link across the card Valid HTML, clean anchor text Crawlers see the links you intended

Where I Keep Finding It

The same handful of patterns account for nearly every instance in real audits.

Pattern What Breaks Fix
Whole card wrapped in <a> with a button inside Button unreachable or unannounced; giant anchor text Stretched link on the title, button as a sibling
<a> inside <a> (card link plus inner tag links) Parser auto-closes the outer anchor and splits the DOM Restructure; nested anchors cannot exist as written
<button> wrapping a link, or vice versa Invalid HTML, double activation, focus confusion Pick one control per action, move the other out
Clickable <tr> via onclick, plus real links in cells Row swallows clicks; AT sees a plain row, not a control One real link in the row; extend its hit area with CSS
tabindex="0" on children of a control Two tab stops for one action, phantom focus targets Remove inner tabindex; one focusable element per control

How to Detect It

  • axe DevTools: the nested-interactive rule names each offending node with a CSS selector. Run it on your card grid, your navigation, and one article template and you will have covered most of the site's components.
  • Lighthouse: the accessibility category runs a subset of axe, so nested controls surface in plain Chrome DevTools with no extension.
  • Keyboard test: tab through a card component. If you can see a button you can never land on, or one tab stop visibly covers two actions, you have found it without any tooling.
  • Source vs rendered DOM: for the nested anchor case specifically, compare view-source with the Elements panel. If anchors sit differently in the two, the parser has been rewriting your markup on every page load.
  • Screaming Frog: a Custom Extraction with an XPath like //a//a | //a//button | //button//a inventories the problem across the whole site in one crawl.

How to Fix It, the Pattern That Works

For cards, the stretched link pattern solves this cleanly and it is what I put in every design system review. The card container is a positioned <div>. The title holds the only anchor. A pseudo element on that anchor (position:absolute; inset:0) stretches its clickable area across the whole card. Secondary actions like Save or Add to cart are sibling buttons layered above the overlay with position:relative and a higher z-index.

  1. Inventory instances with axe plus the Screaming Frog extraction above.
  2. For each, name the primary action. That element keeps the anchor or button; everything else becomes a sibling.
  3. Apply the stretched link pattern where a large hit area is wanted. Do not re-wrap the container in an anchor.
  4. Strip stray tabindex attributes and interactive ARIA roles from children of controls.
  5. Re-run axe, then re-do the keyboard pass: every visible control gets its own tab stop, in a sensible order, and Enter or Space activates exactly the thing that is focused.

What good looks like: valid markup where every interactive element is a leaf, anchor text that matches the visible link label, and a rendered DOM identical in structure to your source. Boring, predictable, crawlable.

DO

  • Keep one interactive control per action, as siblings
  • Use the stretched link pattern for large card hit areas
  • Give the anchor the card title as its text, not the whole card
  • Tab through components by hand after every refactor
  • Compare source and rendered DOM when anchors behave oddly

DON'T

  • Wrap entire cards in an anchor that contains buttons or links
  • Nest an anchor inside an anchor, ever: the parser will not let it survive
  • Add onclick to rows or containers that hold real links
  • Sprinkle tabindex="0" inside existing controls
  • Assume passing axe on one page clears a component used on two hundred

FAQ

Is This an SEO Issue or Just an Accessibility Issue?
Mostly accessibility, with one real SEO exception: nested anchors. The parser splits those, which changes link boundaries and anchor text in the rendered DOM that Googlebot processes. If your internal linking relies on card links, that is worth caring about beyond compliance.
Why Does axe Rate Nested-Interactive as Serious Rather Than Minor?
Because the failure mode is losing access to a function, not cosmetic noise. A keyboard or screen reader user may be unable to reach the inner control at all, which fails WCAG 2.1.1. Issues that block task completion sit above issues that merely annoy.
What Is the Right Markup for a Clickable Card With a Save Button?
Positioned div container. One anchor on the card title, stretched across the card with an absolutely positioned pseudo element. The Save button is a sibling of the anchor, layered above the stretched area with position relative and a higher z-index. Two tab stops, both announced correctly, valid HTML.
Does a Link Inside a Summary Element Count?
Yes. The <summary> element is itself an interactive control (it toggles the disclosure), so a link inside it is a nested interactive and axe flags it. Put links in the expanded content of the details element instead, and keep the summary as a plain toggle label.

One Flagged Component Usually Means a System-Wide Pattern

Nested controls ship from design systems, so a single axe finding often multiplies across every listing page you have. An Advanced SEO Audit traces flagged components to their templates and hands your developers exact, prioritized fixes.

Tìm lỗi này trên trang của bạn

Neova chạy mục kiểm tra này và mọi mục khác trong mỗi lần crawl, rồi viết cách sửa thành ticket cho nhóm của bạn.

  • Ứng dụng máy tính cho Mac, Windows và Linux
  • Tất cả 696 mục kiểm tra, mỗi mục kèm nguồn
  • Search Console và Analytics 4, kết nối chỉ đọc
  • Ticket sang Jira, Linear và Asana

Tải Neova Gói Desktop Free, hoặc dùng thử Solo miễn phí 14 ngày, không cần thẻ.

Tất cả mục kiểm tra Khả năng truy cập · Hướng dẫn · Thư viện mục kiểm tra

Do Neova Labs biên soạn · Quay lại Thư viện mục kiểm tra