# HTML Anchors? (not Discourse bookmarks)

**URL:** https://meta.discourse.org/t/html-anchors-not-discourse-bookmarks/77241
**Category:** Support
**Created:** [4 januari 2018 om 13:04 UTC](https://meta.discourse.org/t/html-anchors-not-discourse-bookmarks/77241 "2018-01-04T13:04:26Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![RobMeade](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/robmeade/32/109119_2.png) [@RobMeade](https://meta.discourse.org/u/RobMeade)
#### Post date: [4 januari 2018 om 13:04 UTC](https://meta.discourse.org/t/html-anchors-not-discourse-bookmarks/77241/1 "2018-01-04T13:04:26Z")

</div>

Hi,

I tried to use HTML to pop some bookmarks _into_ a post today, so that from another link you could get to a specific point in a lengthy post.

I couldn’t seem to get it to work, is this something which isn’t currently supported?

I added this within the post;

```plaintext
<a id="bookmark"></a>

```

..and then, on the end of the URL in the browser, added;

```plaintext
#bookmark

```

I hit enter, but nothing changed, e.g. I wasn’t scrolled down to the bookmark automatically. What I am trying to incorporate is the same functionality I suppose as you already use for the _replies_ to a topic (the reply numbers etc), but this would be for say a wiki post which doesn’t have replies, it’s just quite long.

---

<div class="post-metadata">

### Author: ![SidV](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sidv/32/119460_2.png) [@SidV](https://meta.discourse.org/u/SidV)
#### Post date: [4 januari 2018 om 13:29 UTC](https://meta.discourse.org/t/html-anchors-not-discourse-bookmarks/77241/2 "2018-01-04T13:29:17Z")

</div>

Go to:

`your-forum.com/guidelines`

Edit, and check how it’s working there 😉

---

<div class="post-metadata">

### Author: ![RobMeade](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/robmeade/32/109119_2.png) [@RobMeade](https://meta.discourse.org/u/RobMeade)
#### Post date: [4 januari 2018 om 13:33 UTC](https://meta.discourse.org/t/html-anchors-not-discourse-bookmarks/77241/3 "2018-01-04T13:33:11Z")

</div>

/facepalm

I didn’t think of that!

Interestingly though, I did try it using the _name_ attribute first and when that didn’t work I used the _id_ instead.

Can you think of any reason why it wouldn’t work if the #bookmark part of the URL was on the end of the topic number?

For example, looking at this topic, I see this in the browser;

```
https://meta.discourse.org/t/html-bookmarks-not-discourse-bookmarks/77241/2

```

I appreciate the `/2` on the end is for the reply, and the previous number, `/77241` is the topic, so, should `/77241#bookmark` work?

* * *

Update

Interesting, taking one the links from the /guidelines page and opening it in a new tab (Chrome) also didn’t exhibit the desired behaviour!

For example;

```
https://community.gamedev.tv/t/forum-guidelines-faq/5#flag-problems

```

Only seem to work if they are clicked on, on the actual page…

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [4 januari 2018 om 13:42 UTC](https://meta.discourse.org/t/html-anchors-not-discourse-bookmarks/77241/4 "2018-01-04T13:42:58Z")

</div>

This was implemented recently – here you go:

> [@Linking to a heading within a post or topic](https://meta.discourse.org/t/deep-linking-to-headings-anchors/47552):
>
> bookmark This guide explains how to link directly to a heading within a Discourse post or topic, enabling users to navigate long posts efficiently. person_raising_hand Required user level: All users Adding headings within long posts can make the content more readable and allow users to link directly to specific sections. This can be particularly useful for navigating extensive discussions and documentation. Summary This guide covers: Creating headings using Markdown Linking directly …

Summary: Use headings and make sure the id starts with `heading--` and it’ll work 🙂

---

<div class="post-metadata">

### Author: ![RobMeade](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/robmeade/32/109119_2.png) [@RobMeade](https://meta.discourse.org/u/RobMeade)
#### Post date: [4 januari 2018 om 13:48 UTC](https://meta.discourse.org/t/html-anchors-not-discourse-bookmarks/77241/5 "2018-01-04T13:48:09Z")

</div>

Thanks for this, is the use of headings mandatory? In my specific case the lengthy page has a number of images on it which I wanted to direct people to specifically, without having to add a heading above each one etc.

I will go and test, but anything further would be appreciated.

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [4 januari 2018 om 13:53 UTC](https://meta.discourse.org/t/html-anchors-not-discourse-bookmarks/77241/6 "2018-01-04T13:53:53Z")

</div>

I couldn’t get it to work with an `<a>` element, so I think it must be a heading.

---

<div class="post-metadata">

### Author: ![RobMeade](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/robmeade/32/109119_2.png) [@RobMeade](https://meta.discourse.org/u/RobMeade)
#### Post date: [4 januari 2018 om 13:56 UTC](https://meta.discourse.org/t/html-anchors-not-discourse-bookmarks/77241/7 "2018-01-04T13:56:50Z")

</div>

Thanks for the info, and yeah, I can’t either… hmm… will have to think on this one as having the text isn’t really what I wanted to do.

* * *

Update

/facepalm moment two…

Ok, so I just added an empty heading tag and of course it works perfectly… it does render a little extra “space” where the heading tag would be, but nothing that’s really a problem.

Thanks both - all good now 🙂

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [13 maart 2020 om 20:22 UTC](https://meta.discourse.org/t/html-anchors-not-discourse-bookmarks/77241/8 "2020-03-13T20:22:15Z")

</div>



---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [6 maart 2024 om 22:17 UTC](https://meta.discourse.org/t/html-anchors-not-discourse-bookmarks/77241/9 "2024-03-06T22:17:20Z")

</div>



---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [4 juni 2024 om 10:15 UTC](https://meta.discourse.org/t/html-anchors-not-discourse-bookmarks/77241/10 "2024-06-04T10:15:19Z")

</div>


