Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

Jump to content

Template:Resize/doc

From Wikipedia, the free encyclopedia
It is to change the font size of a text string.

Usage

[edit]
  • {{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.
  • {{resize|div=yes|text}} — As above but uses a div tag instead of a span tag.

Beware

[edit]

Beware that if text happens to contain an equality sign (=), it will fail to render properly. Here are the workarounds:

  1. Replace all instances of = with {{=}}, or
  2. 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:

  1. Use, for example,
    <div style="font-size:90%;">
    ...multiple paragraphs...
    </div>, or
  2. Apply this template separately to each block of paragraph, bullet point etc.
  3. Use {{resize|div=yes}}.
  4. Use {{smalldiv}}.

Examples

[edit]
CodeResult
{{resize|This text defaults to 90% normal size.}}This text defaults to 90% normal size.
{{resize|80%|This text is 80% normal size.}}This text is 80% normal size.
{{resize|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

[edit]
Font size templates
Code for inline contentCode for block contentSizeResult
{{small|text}}{{smalldiv|text}}85%text
{{resize|text}}{{resizediv|text}}90%text
nonenone100%text
{{large|text}}{{largediv|text}}120%text
{{huge|text}}180%text
{{resize|x%|text}}{{resizediv|x%|text}}customvaries
{{font|size=x%}}customvaries

See also

[edit]

TemplateData

[edit]
This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Resize in articles based on its 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.

Template parameters

ParameterDescriptionTypeStatus
Size/Text1

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%').

Stringrequired
Text when size is given2

The text to display in the two parameter version.

Stringoptional
Use div tagdiv

Set to yes to use a div instead of a span tag.

Stringoptional
Size (percent)size

Font size as a percentage e.g. '90', '200'. Ignored if 2 numbered parameters are used.

Unknownoptional