Skip to content

What's the use of the hashtag # (number sign) in the links?

While working on a Web page you might see a link that’s like this:

<a href="#">features</a>

href="#" here is a placeholder. The link will not point to anything in particular.

Sometimes it means the app is in progress, and we’ll fill that link href attribute later on.

Other times you’ll see this:

<a href="#features">features</a>

In this case the link references a point in the same page.

You’ll have an element like this:

<a id="features">Features</a>

It can also be an empty element, which will be there, but hidden:

<a id="features"></a>

Notice we used id here.

Clicking the

<a href="#features">features</a>

item will bring to the <a> with the id equal to features.

To complete this description, if the link is

<a href="/features">features</a>

clicking this the browser will open on a separate URL.

You can also combine those, so

<a href="/features#first">features</a>

will open the /features URL, and will scroll to the <a> tag with id="first".


→ Get my HTML Handbook

download all my books for free

  • javascript handbook
  • typescript handbook
  • css handbook
  • node.js handbook
  • astro handbook
  • html handbook
  • next.js pages router handbook
  • alpine.js handbook
  • htmx handbook
  • react handbook
  • sql handbook
  • git cheat sheet
  • laravel handbook
  • express handbook
  • swift handbook
  • go handbook
  • php handbook
  • python handbook
  • cli handbook
  • c handbook

subscribe to my newsletter to get them

Terms: by subscribing to the newsletter you agree the following terms and conditions and privacy policy. The aim of the newsletter is to keep you up to date about new tutorials, new book releases or courses organized by Flavio. If you wish to unsubscribe from the newsletter, you can click the unsubscribe link that's present at the bottom of each email, anytime. I will not communicate/spread/publish or otherwise give away your address. Your email address is the only personal information collected, and it's only collected for the primary purpose of keeping you informed through the newsletter. It's stored in a secure server based in the EU. You can contact Flavio by emailing flavio@flaviocopes.com. These terms and conditions are governed by the laws in force in Italy and you unconditionally submit to the jurisdiction of the courts of Italy.

Related posts about html: