ANCHOR tag

Dragonwhisky

Premium
6,322
United States
GTPlanet
Dragonwhisky
Ok, I stopped by https://www.gtplanet.net/forum/help/bb-codes on a whim from a link here and discovered the ANCHOR tag exists.

So, I went to one of my old posts here and inserted the anchor tags around a section.
Questions regarding the use of [ANCHOR];
  • Is there a limitation on how much text can be wrapped by the anchor tags?
  • How, and where, can I place links to this section?
  • Can it be linked to from separate posts?
  • Can it be linked to from different threads?

Thanks.
 
Is there a limitation on how much text can be wrapped by the anchor tags?
No, but the page will jump to the top of the anchor section.

How, and where, can I place links to this section?
After you create an anchor, you can link to by appending the anchor name with an octothorpe (or hashtag) to the end of the page URL.

For example, if you wanted to use an anchor named #myanchor in this very thread, the URL would look like this:

https://www.gtplanet.net/forum/threads/anchor-tag.346768/#myanchor

When the page loads, it will jump to the start of that anchor section. It can be linked to from anywhere.
 
Correct, the middle one is the only one that would work. (It's important to have some understanding of HTML and how URLs and anchor tags work to really make use of these tags.) Basically, the browser loads the page at the URL. After it loads, if the URL has the anchor specified, it will jump to that section of the page.

The first one didn't work because the thread page number isn't specified in the URL, so it loaded the first page of the thread. That anchor doesn't exist on the first page of the thread, so it didn't do anything.

The second one didn't work because the link includes an anchor to a specific post, #post-8825250, which is then preceded by your custom anchor. URLs can only have one anchor, so the browser just sees one big long anchor that looks like #page-1213#IRInstructions. That long anchor doesn't exist on the page, so it just leaves you sitting at the top of page 1213.
 
Are anchor tags supposed to underline the text that is anchored?

Like this?

I typed:
[ANCHOR=dec20test]Like this[/ANCHOR]?

Edit:
It was underlined in the preview but not the post.
Screenshot_20201220-174510~2.png
 
Last edited:
anchor="post_section"]Post Section to be Linked To[/anchor]


I'm trying to figure out what the "post_section" is.
 
Last edited:
anchor="post_section"]Post Section to be Linked To[/anchor]


I'm trying to figure out what the "post_section" is.
It's just whatever is in the post between the tags. The part of the post you want to be able to link to. You don't need to type anything special in there to make it work.
It's the part that was underlined in my screenshot.


Edit:
Sorry I've just described the part labelled as "Post Section to be Linked To".

"post_section" is a label you create that will form part of the URL.
You can see mine were "dec20test" and "wline" which are labels I chose.
I think I've got that right now?
 
Last edited:
Back