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".

→ Download my free HTML Handbook!



You might be interested in those things I do:

  • Learn to code in THE VALLEY OF CODE, your your web development manual
  • Find a ton of Web Development projects to learn modern tech stacks in practice in THE VALLEY OF CODE PRO
  • I wrote 16 books for beginner software developers, DOWNLOAD THEM NOW
  • Every year I organize a hands-on cohort course coding BOOTCAMP to teach you how to build a complex, modern Web Application in practice (next edition February-March-April-May 2024)
  • Learn how to start a solopreneur business on the Internet with SOLO LAB (next edition in 2024)
  • Find me on X

Related posts that talk about html: