Template:Link style: Difference between revisions

From Hololive Fan Wiki
Content added Content deleted
No edit summary
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>[[{{{1}}}|<span style={{{style|color:#ffffff;}}}>{{{2|{{{1}}}}}}</span>]]</includeonly><noinclude>
<includeonly>[[{{{1}}}|<span style={{{style|color:#ffffff;}}}>{{{2|{{{1}}}}}}</span>]]</includeonly><noinclude>
This template lets you style wikilinks (a.k.a internal links). It is mainly used to style <code>text-decoration</code>, <code>color</code>, and <code>background</code>, which are often overridden by styles within <code><nowiki><a></a></nowiki></code> tags placed post hoc by the wikitext parser. The alias <code>'''ls'''</code> can be used instead of <code>'''Link style'''</code>.
This template lets you style links that are enclosed within <code>[[</code> and <code>]]</code>(i.e. internal links and interwiki links). Technically speaking, it is mainly used to style the <code>text-decoration</code>, <code>color</code>, and <code>background</code> attributes, which are often overridden in <code><nowiki><a></a></nowiki></code> tags placed post hoc by the wikitext parser. The alias <code>'''ls'''</code> can be used instead of <code>'''Link style'''</code>.

== Usage ==
== Usage ==
<code>&lbrace;&lbrace;'''Link style'''|<var>link target</var>|<var>link text</var>|style=<var>style</var>&rbrace;&rbrace;</code>
<code>&lbrace;&lbrace;'''Link style'''|<var>link target</var>|<var>link text</var>|style=<var>style</var>&rbrace;&rbrace;</code>
Line 9: Line 10:
== Examples ==
== Examples ==
* <code><nowiki>{{Link style|Hololive Production|Hololive|style="background:#27c7fe; color:#ffffff;"}}</nowiki></code> = {{Link style|Hololive Production|Hololive|style="background:#27c7fe; color:#ffffff;"}}
* <code><nowiki>{{Link style|Hololive Production|Hololive|style="background:#27c7fe; color:#ffffff;"}}</nowiki></code> = {{Link style|Hololive Production|Hololive|style="background:#27c7fe; color:#ffffff;"}}
* <code><nowiki><span style="background-color:#27c7fe;>{{ls|Hololive Production}}</span></nowiki></code> = <span style="background-color:#27c7fe;>{{ls|Hololive Production}}</span>
* <code><nowiki><span style="background-color:#27c7fe;></nowiki>'''<nowiki>{{ls|Hololive Production}}</nowiki>'''<nowiki></span></nowiki></code> = <span style="background-color:#27c7fe;>{{ls|Hololive Production}}</span>


== External links ==
== External links ==
This template does not work for external links. To style external links, just do something like this:
This template does not work for external links. To style external links, just do something like this:


<code><nowiki>[https://en.wikipedia.org/wiki/Hololive_Production <span style="color:#27c7fe;">Hololive Production on the English Wikipedia</span>]</nowiki></code> = [https://en.wikipedia.org/wiki/Hololive_Production <span style="color:#27c7fe;">Hololive Production on the English Wikipedia</span>]
<code><nowiki>[https://hololive.hololivepro.com/en/ <span style="color:#27c7fe;">Hololive official website</span>]</nowiki></code> = [https://hololive.hololivepro.com/en/ <span style="color:#27c7fe;">Hololive official website</span>]


== What if I only want to style ''part'' of a link text? ==
== What if I only want to style ''part'' of a link text? ==
Here is basically how the template works. Go nuts.
For more granular control, this template falls short. Instead, here is basically how this template works.


<code><nowiki>[[Hololive Production|<span style="text-decoration:red wavy underline">Hololive</span> Production]]</nowiki></code> = [[Hololive Production|<span style="text-decoration:red wavy underline">Hololive</span> Production]]
<code><nowiki>[[Hololive Production|<span style="text-decoration:red wavy underline">Hololive</span> Production]]</nowiki></code> = [[Hololive Production|<span style="text-decoration:red wavy underline">Hololive</span> Production]]

Latest revision as of 02:49, 14 September 2021

This template lets you style links that are enclosed within [[ and ]](i.e. internal links and interwiki links). Technically speaking, it is mainly used to style the text-decoration, color, and background attributes, which are often overridden in <a></a> tags placed post hoc by the wikitext parser. The alias ls can be used instead of Link style.

Usage[edit]

{{Link style|link target|link text|style=style}}

  • link target - Required. The name of the wiki page you want to link to.
  • link text - Optional. The text to display instead.
  • style – Optional. Takes the value of color:#ffffff; if omitted. You will need to add quotation marks if you have spaces.

Examples[edit]

  • {{Link style|Hololive Production|Hololive|style="background:#27c7fe; color:#ffffff;"}} = Hololive
  • <span style="background-color:#27c7fe;>{{ls|Hololive Production}}</span> = Hololive Production

External links[edit]

This template does not work for external links. To style external links, just do something like this:

[https://hololive.hololivepro.com/en/ <span style="color:#27c7fe;">Hololive official website</span>] = Hololive official website

What if I only want to style part of a link text?[edit]

For more granular control, this template falls short. Instead, here is basically how this template works.

[[Hololive Production|<span style="text-decoration:red wavy underline">Hololive</span> Production]] = Hololive Production