DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk2 min

How to Make a Link’s Whole Area Clickable with CSS

A link’s clickable area can extend beyond its visible words. Learn the block-and-padding technique and how to assess it against WCAG 2.2 target-size and focus guidance.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To make more of the area around a link clickable, enlarge the anchor’s interactive box—not just the words that look like a link. For a suitable text block, put the text inside one anchor, set that anchor to display: block, and add padding. Harry Roberts demonstrated this in a 2011 CSS Wizardry article; the technique remains useful, but its 20px padding is an example, not a current accessibility sizing standard.

How does enlarging a link’s hit area work?

A link’s hit area is the region that responds to pointer input. It can be larger than the visible call-to-action words. When a link wraps a suitable block of text and is displayed as a block, padding on the anchor expands its interactive area around that content.

As an Amazon Associate I earn from qualifying purchases.

In his 12 January 2011 example, Harry Roberts wraps a sentence in an anchor, uses display: block and padding: 20px, then styles the emphasized call to action separately. The words can remain the visual focus while the surrounding area is also part of the link. See Roberts’s original CSS Wizardry example.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use this pattern only when the whole text block leads to the same destination. Avoid wrapping unrelated links or other interactive controls inside the enlarged anchor.

#1 Best Overall
Sale
HTML and CSS: Design and Build Websites
  • HTML CSS Design and Build Web Sites
  • Comes with secure packaging
  • It can be a gift option

How large should the clickable area be?

The 20px in the 2011 example is padding, not the final width or height of the target. The rendered target also depends on the content and layout. WCAG 2.2 Success Criterion 2.5.8 (Level AA) sets a minimum pointer-target size of 24 by 24 CSS pixels, subject to exceptions. WCAG 2.2 became a W3C Recommendation on 5 October 2023. Read the W3C explanation of Target Size (Minimum) and the WCAG 2.2 Recommendation.

The criterion’s exceptions include equivalent controls, inline targets constrained by text, user-agent controls, essential presentation, and spacing. Under the spacing exception, an undersized target may qualify if the defined 24 CSS pixel diameter circles around it do not intersect another target’s circle. The W3C recommends meeting the minimum size where possible, even when spacing could be used instead.

Check the rendered interactive region and nearby controls at the layouts you support. A visual change alone does not prove that the pointer target is large enough, and adding padding can affect how a link sits beside neighboring targets or behaves when text wraps.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Which approach fits a small or restrained link?

Approach When it fits What to check
Enlarge the anchor with block layout and padding A suitable text block has one destination and can be a single link. Rendered target dimensions, neighboring controls, text reflow, and visible keyboard focus. The CSS Wizardry article demonstrates this approach.
Keep the target undersized but provide spacing The target may qualify under WCAG 2.2 SC 2.5.8’s spacing exception. Whether the specified circles around the undersized target and nearby targets intersect; spacing is an exception, not the same as enlarging the target.
Leave the link inline The target’s size is constrained by text flow and the inline-target exception applies. How the link behaves as text reflows and whether the exception applies to the actual presentation.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How do you keep an enlarged link usable with a keyboard?

Make sure the link can receive keyboard focus and that its focus is visibly indicated. WCAG 2.2 Success Criterion 2.4.7 requires visible keyboard focus; it does not prescribe one specific indicator design. See the W3C guidance on Focus Visible. Check the focused link in the same layout used to assess its pointer target.

Rank #3
Sale
Web Design with HTML, CSS, JavaScript and jQuery Set
  • Brand: Wiley
  • Set of 2 Volumes
  • A handy two-book set that uniquely combines related technologies Highly visual format and accessible language makes these books highly effective learning tools Perfect for beginning web designers and front-end developers

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.