Use Anchors on a page

Posted by Helmut_pdorf on 28 Nov 2010 10:16, last edited by Tom Levini on 01 Jun 2017 21:38

Tags: anchhor howto

rating: +9+x

Top:

This page explains how you can use "anchors" - linking inside a page.

The documentation ( this link is using an "anchor" on the documentation page!) says only following:
To place an anchor use [[# anchor-name]] syntax. To refer to an anchor (and scroll to it) use [#anchor-name text to display].

1. What are anchors?

"Anchors" are /Url - addresses "inside" a page. A good example is the real usage with ToC-entries: every "Table of Content" entry is using an (invisible) anchor by automatic numbering the headers. If you click on one of the ToC-Entries top right this ´page you will detect that:

  • the cursor jumps to the heading line referred in the ToC-entry you have clicked,
  • the page is shifted up so that the header is tried to be centered vertically on the screen,
  • on the address-bar of your browser you will see the internal addressing of the used anchor as an extension of the page-Url.

2. How are they defined?

As the documentation says:

  • To place an anchor use [[# anchor-name]]
  • example: I have inserted an anchor at the absolut beginning position of this page: [[# top]]
  • notice the anchor itself is unvisible on the page!

3. How are they adressed?

As the documentation says:
To refer to an anchor (and scroll to it) use [#anchor-name text to display].

This means you can insert anywhere one or more often an "inside Link" on your page to the wished anchor with this syntax:
[#top ==>up to top] .
If you give them a right side alignment this looks than in the usage of this:
[[>]]
[#top ==>up to top]
[[/>]]

4. What is bad with anchors?

Anchors on a page are invisible !
If you want to make them visible you have to repeat the anchors-name or a similar meaning under a highlithing formatting technic. Means you can use Bolding or sizing style formatter. like the Top at the top of this page.

5. Can anchors be linked from other pages?

Yes, the are part of the Url if you want in an "outer" link:
[*http://www.wikidot.com/doc:wiki-syntax#toc22 Anchor-documentation] is a typical usage of an anchor in an "outgoing" link using the opening of a new page…:
Anchor-documentation

6. Example of such anchor-usage:

http://community.wikidot.com/howto:site-checklist#1-site-creation leads to the first self written anchor on that page … have a look on the source how this is managed to avoid an automatic ToC and simulate it by using "anchors".


Related articles

Comments

Add a New Comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.