Difference between revisions of "Template:Highlighted anchor"

From blackwiki
Jump to navigation Jump to search
imported>Dominic Mayers
imported>JsfasdF252
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<templatestyles src="Highligthed_anchor/styles.css" /><span class="highlighted_anchor">{{{{1|}}}</span><noinclude>
+
<templatestyles src="Highlighted_anchor/styles.css" /><span class="highlighted_anchor">{{{1|}}}</span><noinclude>
  
 
{{Documentation}}
 
{{Documentation}}
 
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS -->
 
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS -->
[[Category:Wikipedia formatting and function templates]]
 
 
</noinclude>
 
</noinclude>

Latest revision as of 20:25, 4 December 2020

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