模板:Smalldiv/doc

来自决策链云智库
< 模板:Smalldiv
Zeroclanzhang讨论 | 贡献2024年1月21日 (日) 22:30的版本 (创建页面,内容为“{{Documentation subpage}} {{Template shortcut|small-div|div-small}} {{COinS safe|n}} {{high risk}} == Usage == Use this template instead of {{tl|small}} or {{tag|small}} to wrap multiple lines of text, or to wrap a template that contains {{tag|div}} tags. This template is a drop-in replacement for {{tl|small}} templates or {{tag|small}} tags that wrap multiple lines or wrap a template containing {{tag|div}} tags. When a {{tl|small}} template or {{tag|small}}…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)

Usage

Use this template instead of {{small}} or small>>...</small> to wrap multiple lines of text, or to wrap a template that contains div>>...</div> tags.

This template is a drop-in replacement for {{small}} templates or small>>...</small> tags that wrap multiple lines or wrap a template containing div>>...</div> tags. When a {{small}} template or small>>...</small> tags wrap multiple lines, Linter errors are caused, typically "Missing end tag", "Misnested tag", or "Stripped tag".

The only parameter, |, is the content that is intended to be rendered at a font size of 85% of normal.

Note that if the = character appears in the content, it should be replaced with {{}}, or the content must be explicitly preceded with |1=. See examples in the table below. Pages ignoring this instruction are likely to appear in Category:Pages using small with an empty input parameter (1).

Examples of uses for {{smalldiv}}
input shows
{{smalldiv|
*One
*Two
*Three}}
  • One
  • Two
  • Three
{{smalldiv|{{unbulleted list|One|Two|Three}}}}
  • One
  • Two
  • Three
{{smalldiv|{{hlist|One|Two|Three}}}}
  • One
  • Two
  • Three
{{smalldiv|{{hidden||{{nowrap|Ichirō Hatoyama – 394<br/>Nobusuke Kishi – 4<br/>''Others'' – 15}}}}}}
Ichirō Hatoyama – 394
Nobusuke Kishi – 4
Others – 15
Example with = character in the content (error):
{{smalldiv|Ichirō Hatoyama = 394<br/>Nobusuke Kishi = 4<br/>''Others'' = 15}}
{{{1}}}
1=:
{{smalldiv|1=Ichirō Hatoyama = 394<br/>Nobusuke Kishi = 4<br/>''Others'' = 15}}
Ichirō Hatoyama = 394
Nobusuke Kishi = 4
Others = 15

When not to use this template

Remember to "avoid using smaller font sizes in elements that already use a smaller font size, such as infoboxes, navboxes and reference sections", per MOS:ACCESS and MOS:SMALLFONT. Using this template within an infobox or a navbox reduces the text size to about 75%, which is smaller than the 85% limit prescribed by the MOS guideline.

Template data

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. See a monthly parameter usage report for Template:Smalldiv in articles based on its TemplateData.

TemplateData for Smalldiv

Tracking category

See also

  • {{bigdiv}} (for wrapping multiple lines in big formatting)
  • {{monodiv}} (for wrapping multiple lines in monospace formatting)
  • {{bold div}} (for wrapping multiple lines in bold formatting)
  • {{italic div}} (for wrapping multiple lines in italic formatting)
  • {{Resizediv}} – block-level template for changing text size
Font size templates
Code for inline content Code for block content Size Result
{{small|<text>}}
{{smaller|<text>}}
{{smalldiv|<text>}} 85% text
{{resize|<text>}} {{resizediv|<text>}} 90% text
{{midsize|<text>}} 92% text
none none 100% text
{{large|<text>}}
{{larger|<text>}}
{{big|<text>}}
{{largediv|<text>}} 120% text
{{huge|<text>}} 180% text
{{resize|<x%>|<text>}} {{resizediv|<x%>|<text>}} custom varies
{{font|<size=x%>}} custom varies