I had seen several comments on Stack Overflow that refer to links with a page jump. I know the format for adding links in comments, but need to know how can I add page jump to in the comment.

I googled for a long time and found several html tutorials to add page jumps but not relevant to my question. Even saw many posts in Meta that deal with comments like Comment Formatting and Magic links , but didn't find any solution.

EDIT If my question is not clear, i can make it more clear through an example. I need to add a link in my comment that links to the url "https://stackoverflow.com/faq" and when someone clicks on the link I need to open this link and scroll the page automatically to the section What is reputation?. How can I do it?

  • What's a page jump? – J. Steen Mar 5 '13 at 12:45
  • page jump! – DD_ Mar 5 '13 at 12:47
  • You mean... A link...? – Doorknob Mar 5 '13 at 12:49
  • OOooh, a named anchor. Gotcha. =D – J. Steen Mar 5 '13 at 12:49
  • 3
    @MilKyWaY regarding your edit this would do it, which is [this would do it](http://stackoverflow.com/faq#reputation). – Bart Mar 5 '13 at 12:59
  • 2
    @Bart While this answers the question, it would be better as a comm- no, wait, wrong boilerplate. – J. Steen Mar 5 '13 at 13:02
  • @Bart thanks! this was what I was looking for... – DD_ Mar 5 '13 at 13:04
  • @Bart can you please tell me how to get the anchor point in case when i need to point to a particular answer in a SO page? – DD_ Mar 5 '13 at 13:26
  • 1
    If you need to point to an answer, go to the bottom of the answer and click on the "share" link. This will give you a URL for that particular answer. – Bart Mar 5 '13 at 13:29
  • @Bart Thanks again! This works – DD_ Mar 5 '13 at 13:30

You can "page jump" or scroll page to anchors by putting a #anchor_name to the end of a link. Now I can say for certain that an element's id value can be used as an anchor, but i'm pretty sure there are more, like name that can be used too.

If you are looking to do this to a Stack Exchange page, then do note that the devs have made it quite easy by providing a lot of helpful and unique ID's throughout the page. If you are wanting to link to an anchor on any random website's page, then you will need to look at the code and find a suitable anchor that you can link to.

So for instance, picking a random post on Meta Stack Overflow, try this link:


And also notice the #anchor part at the end of it.

| improve this answer | |
  • so do you mean just like adding links in comments, just add #anchor_name to the end of that link? – DD_ Mar 5 '13 at 12:52
  • yes...........! – bPratik Mar 5 '13 at 12:55
  • ok..that make sense, but how do you get this "comment17907_9958"? – DD_ Mar 5 '13 at 12:55
  • 4
    if you clicked on the timestamp of the comment and checked the address bar you'll see it. Otherwise just check the source of that element and find the nearest element with id. – bPratik Mar 5 '13 at 12:57
  • And for linking directly to answers, you simply hit the "share" link underneath it and copy the link displayed. Just supplemental info, nothing to do with comments, just good to know. =) – J. Steen Mar 5 '13 at 12:59
  • @J.Steen please see my edited question – DD_ Mar 5 '13 at 13:00
  • 2
    @MilKyWaY Ooooh. Just click "What is reputation", and the address bar will be updated with a direct link. When in doubt, click. Everywhere. ;) – J. Steen Mar 5 '13 at 13:01
  • @MilKyWaY - yes, check the # part: stackoverflow.com/faq#reputation – bPratik Mar 5 '13 at 13:02
  • @bPratik thats it! thanks..... – DD_ Mar 5 '13 at 13:04
  • @MilKyWaY - Erm... J.Steen was actually right on target and was actually trying to help... I don't understand the reason for your last comment? – bPratik Mar 5 '13 at 13:07
  • @bPratik oh god! Actually I did misunderstand. Sorry Steen – DD_ Mar 5 '13 at 13:07
  • @J.Steen oh god! Actually I did misunderstand. Sorry Steen – DD_ Mar 5 '13 at 13:08
  • 1
    @MilKyWaY No harm done. One has to have fairly thick skin on the Stack Exchange sites. =) – J. Steen Mar 5 '13 at 13:08

If you're looking to find out where to find the anchor name on comments, click at the timestamp shown i the comments after the username.

For eg. Try this link to jump on the same page, to the first comment.

| improve this answer | |
  • Sorry, I was looking to find out how to add the anchor name on comments. – DD_ Mar 5 '13 at 13:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .