Anchors
It’s easy to manually add anchors to any block element with an identifier attribute and to reference them with a Markdown link.
Syntax
When we manually add an anchor attribute, we usually want to place on or more references somewhere else.
Anchor
We add the anchor as an identification attribute like any other attribute. We can use the long form id=our-identifier
or the short form #our-identifier
:
This is the text block, we would like to refer to from another place on this
page or from another page on this site.
{id=our-identifier}
Reference
- From same page
- The reference is a link to the anchor
[link to anchor](#our-identifier)
. - From another page
- The reference is a link to the page with the anchor appended
[link to anchor](page#our-identifier)
.
Layout
This is the text block, we would like to refer to from another place on this page or from another page on this site.
And this is the reference. When the anchored block is targeted by a reference, it gets a little background highlighting. Usually the anchored block is far away from the reference. Then, the browser jumps to right place first.