HTML5 Placeholder Links

Michael Walsh
By Michael WalshPublished

Uses for the HTML5 placeholder link, a link element but without the href attribute.

In HTML5 the humble anchor element has changed so it no longer requires any attributes, even the href attribute is optional and without any attributes the resulting element is known as a placeholder link, for example:

<a>Placeholder Link</a>

Placeholder links are therefore a good replacement for links to a ”#” frequently used by web designers to indicate a link in a page when the link destination is not yet finalised, for example:

<a href="#">Example Link</a>

Using placeholder links should therefore save some client confusion as they still allow normal styling but cannot actually be clicked.

Another use for placeholder links could be the current state in navigation menus. Rather than adding a class of “current” or similar to the anchor or parent element the href attribute could simply be removed. It’s then possible to style the placeholder links differently, firstly by styling the anchor elements which styles all the links including the placeholder links and then style the a:link selector which only targets anchor elements that have a href attribute.

Styling the anchor elements in this way isn’t great as it’s likely you may need to undo some styling added to the anchor elements when styling the a:link selector so you could use a:not([href]) to target just the placeholder links although without using Selectivzr that wouldn’t work in older versions of IE.

We use cookies to make this website work, to understand how it's used, and to measure our advertising. Find out more about cookies.

Cookie preferences

make an enquiry

Quick form · 3 steps · 1 min

How can we help?

Pick the closest match. We reply within one business day.

I am looking for

Website

New marketing website, microsite or redesign

E-commerce

Shopify store, new or rebuilt

Web application From £10,000 + VAT

Bespoke software and internal tools

AI implementation From £10,000 + VAT

Practical AI in your existing systems

Data visualisation From £10,000 + VAT

Dashboards and data pipelines

Migrations, hosting & support

Website migrations, web hosting and ongoing support

Something else / not sure yet

Let's talk it through

Prefer to talk?

Step 1 of 3

We'll be in touch within one business day to discuss your project. In the meantime, feel free to drop us a line at hello@enovate.co.uk if anything else comes up.

book directly

Book a discovery call with Michael

Michael Walsh, Founder & Managing Director. Pick a time that suits you, add your name and email, and the calendar invitation is yours.

Loading available times…

You can still book through the full calendar, or send us a message.

Times shown in . The calendar invitation lands in your inbox the moment you confirm.

Booking is handled by Calendly; see our privacy policy.

You're booked in

(). The calendar invitation is on its way to .

RescheduleCancel