Help:Anchors

From Wikipedia, the free encyclopedia

This is a copy of the master help page at Meta. Do not edit this copy.
Edits will be lost in the next update from the master page. See below for more information.


Editing
Start new pages
Page name

Referencing
Links
Piped links
Interwiki linking
Footnotes (References)

Formatting
Wikitext
Lists & Tables
Image & file uploads
Formulae

Organising
Sections
Categories
Redirects (forward)
Namespaces
Moving a page
Page size

Fixing mistakes
Reverting edits
Show preview

Saving effort
Editing shortcuts
Edit toolbar
Magic words
Templates
Variables
Calculation

Communicating
Edit summary
Talk page
Edit conflict
Minor edit

Other
Characters
Sandbox


Template:Phh:Anchors

Contents

Setting anchors

  • headers automatically become html anchors, which can be linked to.
  • The <a> tag is not allowed in MediaWiki, so we can't do the <a name="link here">, but we can do the "id" html attribute to almost any existing tag. For example, <div id="what_to_link_to">text</div> or <div id="what_to_link_to"/>text.

Referencing anchors

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

Linking to a position in an external page

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


edit

Wikipedia-specific help

Template:Ph:Anchors


This page is a copy of the master help page at Meta (for general help information all Wikimedia projects can use), with two Wikipedia-specific templates inserted. To update the main text, edit the master help page for all projects at m:Help:Anchors. For Wikipedia-specific issues, use Template:Ph:Anchors (the extra text at the bottom of this page) or Template:Phh:Anchors for a Wikipedia-specific lead (text appears at the top of this page). You are welcome to copy the exact wikitext from the master page at Meta and paste it into this page at any time. To view this page in other languages see the master page at Meta.