<span class="mw-page-title-namespace">Template</span><span class="mw-page-title-separator">:</span><span class="mw-page-title-main">Anchor</span>
Fabrice P. Lauss𝕪s inelike Web

A landing place: it gives a spot on this page a name, so that another page can link straight to it.

Nothing to close and nothing to enclose: the call is the tag. It leaves no mark and takes no room — the anchor is an empty <span>, which stays inside the paragraph it sits in. Until August 2026 this template used a <div> instead, and a block element cuts the paragraph in two wherever it lands, which is where the stray vertical gap came from. Do not reach for <span id="spot"/> by hand either: MediaWiki does not accept a self-closed span and reads it as an opening tag, quietly wrapping the rest of the line in it.

Up to four names for one place, when a spot has been renamed and old links should still arrive:

Template:((anchor|spot|old name|older nameTemplate:))

The name is used verbatim as the HTML id, so keep it plain: letters, digits, hyphens. A name may open with a digit — an {{af}} tag such as 0Boom does — which is valid HTML and works for links and for getElementById, but is not a valid CSS selector: #0Boom in a stylesheet is ignored and querySelector('#0Boom') throws. It only matters if you later want to style or script that spot.

Headings already carry anchors of their own — Page name#Section title works with no template at all, so this is for places a heading does not mark.

Plain wikitext on purpose: it was briefly implemented through Module:Anchor, which broke every use on laussy.org with "Script error: No such module" because the module lives only on the local wiki. A template this small should not need Lua, and now needs nothing but ParserFunctions.