Predloga:Resize
Videz
{{{1}}}
Predloga se uporablja na številnih straneh, zato bo vsaka njena sprememba takoj zelo opazna. Prosimo, da vse spremembe, ki jih želite uvesti, pred uvedbo preizkusite na podstraneh predloge (/peskovnik in /testniprimeri) ali na svojih lastnih podstraneh. Pred spreminjanjem te predloge se o želenih spremembah rajši pogovorite na pogovorni strani. |
Ta predloga se ne sme uporabljati v predlogah za navajanje v slogih, kot sta slog navajanja 1 in slog navajanja 2, ker vključuje označevanje, ki bo kontaminiralo metapodatke COinS, ki jih te ustvarijo. |
It is to change the font size of a text string.
Usage
[uredi kodo]{{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
[uredi kodo]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.
- Use {{resize|div=yes}}.
- Use {{smalldiv}}.
Examples
[uredi kodo]Code | Result |
---|---|
{{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
[uredi kodo]Koda za znotrajvrstično vsebino | Koda za vsebino bloka | Velikost | Rezultat |
---|---|---|---|
{{small|besedilo}} {{smaller|besedilo}} |
{{smalldiv|besedilo}} |
85 % | besedilo |
{{resize|besedilo}} |
{{resizediv|besedilo}} |
90 % | besedilo |
{{midsize|besedilo}} |
92 % | besedilo | |
Predloga:CNone | Predloga:CNone | 100 % | besedilo |
{{large|besedilo}} {{larger|besedilo}} {{big|besedilo}} |
{{largediv|besedilo}} |
120 % | besedilo |
{{huge|besedilo}} |
180 % | besedilo | |
{{resize|x%|besedilo}} |
{{resizediv|besedilo}} |
po meri | variira |
{{font|size=x%}} |
po meri | variira |
See also
[uredi kodo]- Kategorija:Resizing templates
- {{smalldiv}}, for wrapping multiple lines of text that cause syntax errors when wrapped by {{resize}} or {{small}}
- font-size - CSS: Cascading Style Sheets | Mozilla Developer Network
TemplateData
[uredi kodo]To je dokumentacija TemplateData za predlogo, ki jo uporabljajo Vizualni urejevalnik in druga orodja; glejte mesečno poročilo o uporabi parametrov za to predlogo.
TemplateData za Resize
Template to aid switching the font-size used for a text string. Two forms {{resize|<size>|<text>}} and {{resize|<text>}} are possible.
Parameter | Opis | Vrsta | Stanje | |
---|---|---|---|---|
Size/Text | 1 | 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%'. | Niz | zahtevano |
Text when size is given | 2 | The text to display in the two parameter version. | Niz | neobvezno |