Help:Anchors

From Meta, a Wikimedia project coordination wiki
Jump to: navigation, search
MediaWiki Handbook: Contents, Readers, Editors, Moderators, System admins +/-
See also: Help:Link#Anchors.

Setting anchors[edit]

See Help:Link#Manual_anchors for a much better written guide.
  • Headers automatically become HTML anchors, which can be linked to.
  • The <a> tag is not allowed in MediaWiki, so one cannot use <a name="link here">; however, one can use the "id" HTML attribute with almost any existing tag. For example, <div id="what_to_link_to">text</div>, <div id="what_to_link_to" />text or alternatively, for inline use in bulleted lists, <span id="what_to_link_to">text</span>.

Referencing anchors[edit]

Inside a regular wikilink [[page#anchor_name|shown_up_as]], include the hash sign (#) and the header name or the id tag name as it is written.

Linking to a position in an external page[edit]

The HTML source of the external target page needs to have <a name=..> or <.. id=..> at the target item, as an anchor to link to. Thus, to link to a position in an external page, for which this is not yet the case, one would need control over the target page or the cooperation of the entity that does.

Links to other help pages[edit]

Help contents
Meta · Wikinews · Wikipedia · Wikiquote · Wiktionary · Commons: · Wikidata · MediaWiki · Wikibooks · Wikisource · MediaWiki: Manual · Google
Versions of this help page (for other languages see further)
What links here on Meta or from Meta · Wikipedia · MediaWiki
Reading
Go · Search · Stop words · Namespace · Page name · Section · Backlinks · Redirect · Category · Image page · Special pages · Printable version
Tracking changes
Recent changes (enhanced) | Related changes · Watching pages · Diff · Page history · Edit summary · User contributions · Minor edit · Patrolled edit
Logging in and preferences
Logging in · Preferences · User style
Editing
Starting a new page · Advanced editing · Editing FAQ · Edit toolbar · Export · Import · Shortcuts · Edit conflict · Page size
Referencing
Links · URL · Piped links · Interwiki linking · Footnotes
Style and formatting
Wikitext examples · CSS · Reference card · HTML in wikitext · Formula · List · Table · Sorting · Colors · Images and file uploads
Fixing mistakes
Show preview · Testing · Reverting edits
Advanced functioning
Expansion · Template · Advanced templates · Parser function · Parameter default · Variable · System message · Substitution · Array · Calculation · Embed page
Others
Special characters · Renaming (moving) a page · Preparing a page for translation · Talk page · Signatures · Sandbox · Legal issues for editors
Languages: English  · français · italiano