Web design and digital-business ideas grounded in real tasks.

A button inside a link creates competing actions

A web designer comparing two clear action controls in a fictional simple laptop interface.
AI-generated photographic illustration; not documentary photography.

A product card needs two actions: open the product page and save the item to a list. Wrapping the whole card in a link, then placing a Save button inside it, looks convenient in markup. It also creates a conflict between two interactive elements occupying the same structure.

The HTML specification for the anchor element does not permit interactive content such as a button inside an anchor. An anchor cannot contain another anchor either. Browser behaviour that appears to work with a mouse does not make the structure valid or dependable.

Give each action its own control

A simple arrangement places the product link and Save button beside each other within a non-interactive container:

<article>
  <h2><a href="/products/blue-mug/">Blue mug</a></h2>
  <p>A description of the product.</p>
  <button type="button">Save blue mug</button>
</article>

The example demonstrates structure only; saving still needs its own implementation. Use a link for navigation and a button for the action. The explicit button type also avoids an unintended form submission if the component later appears inside a form.

If the design requires a larger clickable region, review how any stretched-link technique overlaps neighbouring controls. A transparent layer covering the Save button can recreate the interaction problem even when the underlying elements are siblings.

Test the two paths separately

Move through the card using the keyboard. The product link and Save button should receive focus as separate, understandable stops. Activate each and confirm that saving does not unexpectedly open the product page.

Then check the pointer behaviour around the edges and test the accessible names with the site’s usual accessibility tools. Several cards containing buttons all labelled only “Save” may need clearer naming so their targets remain understandable out of visual context.

The aim is a card whose controls express the actual choices. A clean separation makes styling, event handling and later changes easier because each element has one clear job.