Template:Serif: Difference between revisions
Jump to navigation
Jump to search
Richardpruen (talk | contribs) m (1 revision imported) |
imported>Esperfulmo (added a default class="serif-fonts" w:Wikipedia:Teahouse/Questions/Archive_1167#Unnecessarily_specified_fonts_in_a_template) |
||
Line 1: | Line 1: | ||
<span style="font-family: 'Georgia Pro', Georgia, 'DejaVu Serif', Times, 'Times New Roman', FreeSerif, 'DejaVu Math TeX', 'URW Bookman L', serif; {{{style|}}}" {{#if:{{{class|}}}|class="{{{class}}}"}} {{#if:{{{id|}}}|id="{{{id}}}"}} {{#if:{{{title|}}}|title="{{{title}}}"}}>{{{1}}}</span><noinclude> | <span class="serif-fonts" style="font-family: 'Georgia Pro', Georgia, 'DejaVu Serif', Times, 'Times New Roman', FreeSerif, 'DejaVu Math TeX', 'URW Bookman L', serif; {{{style|}}}" {{#if:{{{class|}}}|class="{{{class}}}"}} {{#if:{{{id|}}}|id="{{{id}}}"}} {{#if:{{{title|}}}|title="{{{title}}}"}}>{{{1}}}</span><noinclude> | ||
{{Documentation}} | {{Documentation}} | ||
<!--Categories and interwikis go on the /doc sub-page.--> | <!--Categories and interwikis go on the /doc sub-page.--> | ||
</noinclude> | </noinclude> |
Latest revision as of 09:03, 22 December 2022
{{{1}}}
Usage
Simply uses CSS to force a serif font on the surrounded content:
{{serif|IV}}
gives:
IV
This is useful when certain letters are always given in a serif font when used as a symbol for something, to distinguish better between lower-case l and Roman numeral I, etc.
Optional parameters
Advanced HTML values can be passed through the template to the HTML code:
|class=
takes a class name (or multiple class names, separated by spaces); addsclass="classname[s]"
to the HTML code|style=
takes inline CSS input; addesstyle="CSS directive[s]"
to the HTML code|id=
takes a valid, unique HTML id (must begin with an alphabetic letter); addsid="name"
to the HTML code|title=
takes text, which cannot be marked up in any way, and displays it as a pop-up "tooltip" when the cursor hovers over the{{serif}}
span