Difference between revisions of "Template:Highlighted anchor"

From blackwiki
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:Visible anchor]]: too many anchors, maximum is 10.</span>}}<noinclude>
+
-->{{#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.

50px Template documentation[view] [edit] [history] [purge]

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:

Click on me to see the effect

Template:Visible anchor

See also