1

Stackoverflow allows comment or answer linking . It means it allows you to create a link to a specific answer or a comment on a post.

My question is how does it drags the browser to that specific post

I know they use id for a specific comment or post.

Which technology or technique is used to create something like this?

I have gone through few post in meta.stackexchange.com but it does not answer the technique or technology used to create it?

Aman
  • 586
  • 8
  • 20

1 Answers1

5

Anchors (or <a /> tags) with fragments and element ids.

<!-- <a> element links to the section below -->
<p><a href="#Section_further_down">
  Jump to the heading below
</a></p>

<!-- Heading to link to -->
<h2 id="Section_further_down">Section further down</h2>
Bertrand Marron
  • 21,501
  • 8
  • 58
  • 94
  • 1
    I will accept this answer. Once I test this on my system. Thanks. Can you suggest more specific or generic question ? So If anyone searches this again they will be redirected here. It could benefit the stackoverflow community. – Aman May 08 '20 at 19:15
  • @Aman The `#` url syntax is general - you can even enter it manually in your browser. For example this is the link to the History section of the article on HTML on wikipedia: https://en.wikipedia.org/wiki/HTML#History – slebetman May 08 '20 at 19:20
  • 1
    *can you suggest a question* - how about this one: https://stackoverflow.com/questions/2835140/how-do-i-link-to-part-of-a-page-hash I found it via https://stackoverflow.com/search?q=link+to+part+of+page – freedomn-m May 09 '20 at 00:09