Difference between revisions of "Anchors - Mediawiki"

From Help Wiki
(Setting anchors)
Line 1: Line 1:
It is possible to link to a specific portion of a page.
+
__NOTOC__
 +
Anchors allow you to link to a specific portion of a page.
  
 
==Setting anchors==
 
==Setting anchors==
Line 19: Line 20:
  
 
Links of the form <code><nowiki>[[#anchor_name]]</nowiki></code> will link to the first anchor on the page matching that "anchor_name", usually the first identical section heading.
 
Links of the form <code><nowiki>[[#anchor_name]]</nowiki></code> will link to the first anchor on the page matching that "anchor_name", usually the first identical section heading.
 +
 +
;See also
 +
*http://meta.wikimedia.org/wiki/Help:Link#Anchors
  
  

Revision as of 12:28, 8 October 2007

Anchors allow you to link to a specific portion of a page.

Setting anchors

Automatic anchors

Section headings automatically act as anchors, with the heading text as the "anchor_name". In the case of multiple sections with identical headings, the anchor name of each has "_2", "_3", etc. appended, starting from the second occurrence.

Manual anchors

Manually-set anchors are useful for linking to "unlinkable" things like a table (title or cell), a section of plain text, etc. There are a number of ways to set an anchor at an arbitrary position:

  • On some wikis, a template called "anchor" exists, providing a simple, standardized method for that wiki.
  • Generic anchor: <span id="anchor_name">some text</span>. For a hidden anchor, omit the text.

Referencing anchors

Inside a regular wiki link [[page#anchor_name|shows_as]], include the hash sign (#) and the header name or the id tag name as you have written it.

Links of the form [[#anchor_name]] will link to the first anchor on the page matching that "anchor_name", usually the first identical section heading.

See also