A Few Things About the Anchor Element’s href You Might Not Have Known

It's easy to take URL superpowers for granted, even if you already have these patterns under your belt. A Few Things About the Anchor Element’s href You Might Not Have Known originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

Sep 8, 2025 - 05:47
 0  6
A Few Things About the Anchor Element’s href You Might Not Have Known

I love “re-learning” things I thought I knew. HTML is full of those opportunities (case in point, like today) since it’s where you typically start learning about web development. And in those early days, you don’t know what you don’t know.

So, thanks Jim Nielsen for giving me a reason to give URL patterns another look. It’s easy to take URL superpowers for granted, even if you already have these patterns under your belt.

The patterns:

 
 
 
 
 
  

But do yourself a favor and read Jim’s full post. He gets way more into the weeds, referencing the specification and stress testing different configurations. I mean, this is gold:

But I’m writing because #top will also scroll to the top if there isn’t another element with id="top" in the document. I didn’t know that.

Me neither.


A Few Things About the Anchor Element’s href You Might Not Have Known originally published on CSS-Tricks, which is part of the DigitalOcean family. You should get the newsletter.

Apa Reaksimu?

like

dislike

love

funny

angry

sad

wow

ahmadsofyan Saya hanya manusia biasa, kesempurnaan hanya milik allah swt.