Difference between revisions of "Template:Highlighted anchor"
Jump to navigation
Jump to search
imported>Dominic Mayers |
imported>Dominic Mayers |
||
| Line 9: | Line 9: | ||
-->{{#if:{{{10|}}}|<span id="{{{10}}}"></span>}}<!-- | -->{{#if:{{{10|}}}|<span id="{{{10}}}"></span>}}<!-- | ||
-->{{#if:{{{1|}}}|<span class="highlighted_anchor" id="{{{1}}}">{{{text|{{{1}}}}}}</span>}}<!-- | -->{{#if:{{{1|}}}|<span class="highlighted_anchor" id="{{{1}}}">{{{text|{{{1}}}}}}</span>}}<!-- | ||
| − | -->{{#if:{{{11|}}}|<span class="error">[[Template: | + | -->{{#if:{{{11|}}}|<span class="error">[[Template:Highligthed anchor]]: too many anchors, maximum is 10.</span>}}<noinclude> |
{{Documentation}} | {{Documentation}} | ||
Revision as of 03:07, 15 June 2020
Page Template:Highligthed anchor/styles.css has no content.
Script error: No such module "Uses TemplateStyles".
Usage
Details are to be written, but basically when you add {{highlighted anchor|some text}} inside the visible part of {{visible anchor}} or inside any potential target (i.e a DOM element that has the :target css modifier) then when the target is reached (using a link with a fragment that is identical to its id) the text "some text" will be highlighted with a bluish grey background.
In the source code, for example, we have
[[#testlink|Click on me to see the effect]]
{{visible anchor
|testlink
|text=This is the visible text of the anchor and {{highlighted anchor|this is the highlighted part of it}}
}}This is rendered as follows:
See also
- {{Visible anchor}}
- {{Anchor}}
- {{Anchored list}}
- {{Shortcut}}
- Help:Link § Section linking (anchors) (Shortcut: WP:ANCHOR)
| The above documentation is transcluded from Template:Highlighted anchor/doc. (edit | history) Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages. Please add categories to the /doc subpage. Subpages of this template. |