Template:Resize
{{{1}}}
Page Module:Documentation/styles.css has no content.
| icon | 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. |
Usage
- Script error: No such module "Template link general". — N specifies a size, such as "95%", "1.2em", etc.
- Script error: No such module "Template link general". — If N is omitted, as in the second line above, a default 90% size is applied.
- Script error: No such module "Template link general". — As above but uses a div tag instead of a span tag.
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 Template:Tlx, or - Specify
Template:TlforTemplate:Tlf.
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.
- Use Template:Tlf.
- Use Template:Tl.
Examples
| Code | Result |
|---|---|
| Script error: No such module "Template link general". | This text defaults to 90% normal size. |
| Script error: No such module "Template link general". | This text is 80% normal size. |
| Script error: No such module "Template link general". | 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 for inline content | Code for block content | Size | Result |
|---|---|---|---|
| Template:Tlx | Template:Tlx | 85% | text |
| Template:Tlx | Template:Tlx | 90% | text |
| Template:CNone | Template:CNone | 100% | text |
| Template:Tlx | Template:Tlx | 120% | text |
| Template:Tlx | 180% | text | |
| Template:Tlx | Template:Tlx | custom | varies |
| Template:Tlx | custom | varies |
See also
- Category:Resizing templates
- Template:Tl, for wrapping multiple lines of text that cause syntax errors when wrapped by Template:Tl or Template:Tl
- font-size - CSS: Cascading Style Sheets | Mozilla Developer Network
TemplateData
TemplateData for Resize
It is to change the font size of a text string. Two forms {{resize|<size>|<text>}} and {{resize|<text>}} are possible.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| Size/Text | 1 | With two parameters: a CSS font size e.g. '80%', '1.2em', 'x-large', 'larger'. With one parameter: the text to display (and font size defaults to '90%'). | String | required |
| Text when size is given | 2 | The text to display in the two parameter version. | String | optional |
| Use div tag | div | Set to yes to use a div instead of a span tag. | String | optional |
| Size (percent) | size | Font size as a percentage e.g. '90', '200'. Ignored if 2 numbered parameters are used. | Unknown | optional |