Skip to main content
WCAGrules
Quick navigation

Guides · Comparisons

Link vs. Button: A Small Choice That Breaks a Lot

One navigates, one acts. Getting it wrong changes what is announced, which keys work, and whether anything happens at all.

Last reviewed August 30, 2026

The rule fits in a line. A link goes somewhere. A button does something.

That is not our formulation, which is worth knowing when the argument reaches a stubborn developer. The ARIA specification defines a link as an interactive reference that causes the user agent to navigate to a resource, defines a button as an input allowing user-triggered actions, and then adds a note settling the whole debate. If pressing the link triggers an action but does not change browser focus or page location, authors are advised to consider using the button role instead. That sentence is the argument, in the standard, in one line.

So if it changes the URL, it is a link. If it submits, opens, closes, toggles, saves, deletes, or plays, it is a button. Styling has nothing to do with it. A link styled as a button is still a link.

Link (a href)Button
Announced as"link""button"
Activated byEnterEnter and Space
Structure inside itSurvives. A heading inside a link is still a headingFlattened. A button's children are presentational, so a heading inside one is a string
Needs an accessible nameYesYes
Right-click menuOpen in new tab, copy addressNothing useful
Middle-clickOpens in a new tabNothing
Listed underThe screen reader's list of linksIts list of buttons or form controls, depending on the reader
PurposeNavigationAction
How links and buttons behave differently

Two of those rows are worth labeling. The keyboard row and the structure row come from the specification, so they hold everywhere. The right-click, middle-click and list rows are how browsers and screen readers behave rather than anything a standard requires, and the exact list a control appears under varies between readers. Both are true. Only one of them is quotable at somebody.

Why It Actually Matters

Screen reader users navigate by pulling up lists. All the links on the page. All the form controls. All the headings. Get the element wrong and your control is in the wrong list, so Add to basket built as a link is not among the buttons where somebody went looking for it.

The keyboard difference is not a technicality either. Buttons answer Enter and Space, and links answer Enter only. Press Space on a link and the page scrolls, which is what a keyboard user gets when they reasonably assume the button-shaped thing is a button.

And link behaviors are real expectations people rely on rather than affordances they merely notice. Open in a new tab. Copy the address. See where it goes in the status bar before committing. None of that works on something that is not going anywhere.

One difference nobody writes about, and it is the one that bites hardest on modern layouts. A button's children are presentational by specification, so everything inside it collapses to a text string. Build a clickable card as one big button and the heading inside it stops being a heading, the list stops being a list, and the image's alt text stops standing on its own. Build the same card so the heading contains the link and all of that survives. That is why the wrapping-link pattern has outlasted every attempt to replace it.

Both of Them Need a Name

Whichever you pick, the specification marks an accessible name as required for both roles. A button showing only an icon has no name, and a link containing only an image with no alt text has an empty one. Both fail 4.1.2 Name, Role, Value, and both leave a speech input user with nothing to say out loud to activate the control. Settling which element to use and stopping there is how a page ends up with the right markup and no names in it. Our fix guides cover naming icon-only controls.

The Failure That is Worse Than Both

A div with a click handler. It works with a mouse and is invisible to everything else. It is not focusable, so a keyboard user never reaches it, and it is not announced, so a screen reader user never knows it exists. Our keyboard guide covers what that costs.

Making it work means adding tabindex, a role, key handling for Enter and Space, and a focus style. That is four things you get free from a native element, and the framing W3C uses is the one to remember. A role is a promise. Writing role="button" on a div promises that you have also written the JavaScript providing the keyboard behavior a button has, because ARIA roles do not cause browsers to provide any behavior at all. Our fix guide covers divs built as buttons, and using the native control is the shorter route.

For the link case there is a fifth thing, and it is the one people are most surprised by. role="link" does not make navigation happen either. It does not bring the context menu actions the table above promised, because those come from the element rather than from the role. So a div carrying role="link" announces as a link, goes nowhere on its own, and offers none of the things a link offers.

Also common: the empty href

<a href="#"> used as a button is a link that goes nowhere, and the list of what breaks is longer than the semantics. It is announced as a link and appears in the links list. Activating it can jump the page to the top. Copying it, dragging it, and bookmarking it all produce something meaningless. And while JavaScript is still loading, or if it errors, or if it is disabled, the control does literally nothing. Note that an <a> with no href at all is a different failure. That one is not focusable and carries no link role, so it fails like the bare div rather than like the fake link, which matters when you are diagnosing rather than describing.

The Edge Cases

  • A link that opens a modal. A button. It does not go anywhere.
  • A button that navigates after saving. Still a button. The navigation is a consequence, not the purpose.
  • Pagination. Links, if each page has its own URL.
  • Tabs. Buttons, inside a composite widget with its own arrow key handling.
  • Skip to content. A link. It moves you within the page.
  • A logo going home. A link.
  • Download. A link, since it points at a file. Say so in the link text as well, because a new tab or a download that arrives unannounced is disorienting for anybody with low vision or a cognitive difficulty, and older screen readers may not announce it at all. The same goes for anything using target="_blank".
  • A toggle. A button, and it needs aria-pressed to say which state it is in. One rule goes with that. The label must not change when the state does. Mute stays Mute, and aria-pressed carries whether it is on. If the design calls for the label to flip between Mute and Unmute, then leave aria-pressed off entirely, because the label is doing the job. Doing both announces the state twice in two different words.

Styling a Link Like a Button

It is fine, it is very common, and it is worth knowing that W3C's own position is a step further than fine. Its guidance on the reverse case, a button styled as a link, is that giving the element the right role helps, and that the better solution is to adjust the visual design so it matches the function and the role. The principle underneath applies to both directions. Both the appearance and the role of a control should match the function it provides.

So style your primary call to action as a button by all means. Just do not let the styling drift so far that people press Space on it and the page scrolls instead.

One honest limit

No scanner can tell you this is wrong. The markup is valid either way, and the element carries no clue about whether it navigates. There is evidence for saying that rather than only an opinion. Every automated rule written against the name, role and value criterion tests whether a name exists rather than whether it is right, and none of them distinguishes a link from a button by what it does. Only a person reading the page can. Our automated versus manual guide covers where that line sits.

Common questions

When should I use a link instead of a button?
When it goes somewhere. If activating it changes the URL, it is a link. If it acts on the current page by submitting, opening, closing, toggling, saving, deleting or playing, it is a button. The specification puts it as advice to authors. If pressing the link triggers an action but does not change browser focus or page location, consider using the button role instead.
Is it OK to style a link to look like a button?
Visually yes, and it is very common. Keep the element right underneath, because the styling changes nothing about which keys work or which list it appears in. W3C's own position on the same territory is that the better solution is to adjust the visual design so it matches the function and the role, so treat a link that looks exactly like a button as a small debt rather than a free choice.
What is wrong with using a div as a button?
It is not focusable and not announced, so keyboard and screen reader users never reach it. Fixing it means adding tabindex, a role, key handling for Enter and Space, and a focus style, all of which a real button gives you free. And a role is only a promise. Writing role="button" declares that you wrote the behavior, because ARIA gives you none of it.
Do links and buttons both need an accessible name?
Yes. The specification marks the name as required on both roles. An icon-only button has none, and a link containing only an unlabeled image has an empty one. Both fail name, role and value, and both leave a speech input user with nothing to say to activate the control.
Why do buttons respond to Space but links do not?
It is the keyboard behavior specified for each role rather than an accident of history. Buttons are activated by Space and Enter. Links are activated by Enter. So it is a contract that comes with the role you chose, which is one more reason the choice is not cosmetic.
Can I put a heading inside a button?
You can, and it stops being a heading. A button's children are presentational by specification, so everything inside collapses to a text string. That is why a clickable card built as one big button loses its internal structure and the same card built with the link inside the heading keeps it.

Sources

Keep reading

More on comparisons

Reading about it is the cheap part.

Find out where your site actually stands. The free scan checks 10 pages in a real browser against all 90 supported automated rules, keeps its 27 best-practice checks separate from WCAG findings, and names the rule behind every finding. The full audit adds an expert review and a real blind screen-reader user. From $499, with the report in 5 business days on Rapid and 10 on Standard, and the clock starting at cleared payment.

Go somewhere useful

Find tools, resources and your workspace.

29 destinations