Template:Resize
{{{1}}}
| This template is used on approximately 91,000 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
| This template should not be used in citation templates such as Citation Style 1 and Citation Style 2, because it includes markup that will pollute the COinS metadata they produce; see Wikipedia:COinS. |
It is to change the font size of a text string.
Usage
{{resize|N|text}}— N specifies a size, such as "95%", "1.2em", etc.{{resize|text}}— If N is omitted, as in the second line above, a default 90% size is applied.
Beware
Beware that if text happens to contain an equality sign (=), it will fail to render properly. Here are the workarounds:
- Replace all instances of
=with{{}}, or - Specify
{{resize|N|2=text}}or{{resize|1=text}}.
Also it will fail to wrap multiple blocks, such as multiple paragraphs or multiple bullet points. Here are the workarounds:
- Use, for example,
<div style="font-size:90%;">
...multiple paragraphs...</div>, or - Apply this template separately to each block of paragraph, bullet point etc.
Examples
| Code | Result |
|---|---|
| This text defaults to 90% normal size.}} | This text defaults to 90% normal size. |
| 80%|This text is 80% normal size.}} | This text is 80% normal size. |
| 1.2em|This text is 0.2em larger than normal.}} | This text is 0.2em larger than normal. |
{{resize|We know 1+1=2 and 2+2=4. It will fail to render}} |
{{{1}}} |
{{resize|We know 1+1{{=}}2 and 2+2{{=}}4.}} |
We know 1+1=2 and 2+2=4. |
{{resize|1=We know 1+1=2 and 2+2=4.}} |
We know 1+1=2 and 2+2=4. |
{{resize|120%|2=We know 1+1=2 and 2+2=4. This text is 120% normal size.}} |
We know 1+1=2 and 2+2=4. This text is 120% normal size. |
Comparison
| Code | Equivalent | Result |
|---|---|---|
| {{smaller|text}} | 90%|text}} | text |
| {{larger|text}} | 110%|text}} | text |
| {{large|text}} | large|text}} | text |
| Code | Size | Semantics | Result |
|---|---|---|---|
{{small|text}} |
85% | <small> |
text |
{{smaller|text}} |
90% | none | text |
{{resize|text}} |
90% | none | text |
{{midsize|text}} |
92% | none | text |
| none | 100% | none | text |
{{larger|text}} |
110% | none | text |
{{big|text}} |
120% | none | text |
{{large|text}} |
large | none | text |
{{huge|text}} |
180% | none | text |
{{resize|x%}} |
custom | none | varies |
{{font|size=x%}} |
custom | none | varies |
See also
TemplateData
This is the TemplateData documentation for this template used by VisualEditor and other tools; see the monthly parameter usage report for this template.
TemplateData for Resize
<templatedata>{
"description": "It is to change the font size of a text string. Two forms <span style="font-size:<size>;"><text> and <text> are possible.",
"params": {
"1": {
"label": "Size/Text",
"description": "Specifies a css font size e.g. '80%', '1.2em', 'x-large', 'larger'. In the one parameter version the first parameter is the text and the font size is '90%'.",
"type": "string",
"required": true
},
"2": {
"label": "Text when size is given",
"description": "The text to display in the two parameter version.",
"type": "string",
"required": false
}
}
} </templatedata>