Template:Collapse top/doc: Difference between revisions
→Parameters: update
w:en>SMcCandlish (→Parameters: documentation overhaul) |
w:en>SMcCandlish (→Parameters: update) |
||
Line 24: | Line 24: | ||
== Parameters == | == Parameters == | ||
This template takes the following parameters, all of which are optional. They are case-sensitive. Those that take CSS measurements require them in CSS format (e.g. <code>{{mxt| | This template takes the following parameters, all of which are optional. They are case-sensitive. Those that take CSS measurements require them in CSS format (e.g. <code>{{mxt|1em}}</code> not <code>{{!mxt|1 em}}</code>. | ||
;{{para|1}}, {{para|title}}<span style="font-weight: normal;">, or first unnamed parameter</span>: Will give the collapsed box a title, which occurs on the same line as the ''show'' link and is always visible. It defaults to "Extended content". For example, <code><nowiki>{{collapse top|title=This is the title text}}</nowiki></code> or <code><nowiki>{{collapse top|This is the title text}}</nowiki></code>. Note: The shorter markup will not work if the title value contain an equals (<code>=</code>) character. | ;{{para|1}}, {{para|title}}<span style="font-weight: normal;">, or first unnamed parameter</span>: Will give the collapsed box a title, which occurs on the same line as the ''show'' link and is always visible. It defaults to "Extended content". For example, <code><nowiki>{{collapse top|title=This is the title text}}</nowiki></code> or <code><nowiki>{{collapse top|This is the title text}}</nowiki></code>. Note: The shorter markup will not work if the title value contain an equals (<code>=</code>) character. | ||
Line 35: | Line 35: | ||
;{{para|border}}: Sets the width of the border line on the collapsed material. defaults to <code>1px</code>. For example, <code><nowiki>{{collapse top|border=2px}}</nowiki></code>; going much thicker than this is not very useful. | ;{{para|border}}: Sets the width of the border line on the collapsed material. defaults to <code>1px</code>. For example, <code><nowiki>{{collapse top|border=2px}}</nowiki></code>; going much thicker than this is not very useful. | ||
;{{para|b-color}}: Sets the border color. defaults to <code>Silver</code> (<code>#C0C0C0</code>). See {{para|bg}}, above, for details on color options. | ;{{para|b-color}}: Sets the border color. defaults to <code>Silver</code> (<code>#C0C0C0</code>). See {{para|bg}}, above, for details on color options. | ||
;{{para|padding}}: Sets the padding (distance from borders) on the collapsed material inside the colored area. Defaults to <code> | ;{{para|padding}}: Sets the padding (distance from borders) on the collapsed material inside the colored area. Defaults to <code>0.6em</code>. | ||
;{{para|width}}: Sets the width of the overall template relative to the page (or a block element containing the collapse box). This should virtually always be given as a percentage, e.g. {{para|width|50%}}, or in relative <samp>em</samp> units, e.g. {{para|width=30em}}. Pixel-based values should be avoided, as they are effectively meaningless – the result will be different depending on each user's browser and local CSS settings (which browser and operating system it is, zoom level, font sizes, etc.). | ;{{para|width}}: Sets the width of the overall template relative to the page (or a block element containing the collapse box). This should virtually always be given as a percentage, e.g. {{para|width|50%}}, or in relative <samp>em</samp> units, e.g. {{para|width=30em}}. Pixel-based values should be avoided, as they are effectively meaningless – the result will be different depending on each user's browser and local CSS settings (which browser and operating system it is, zoom level, font sizes, etc.). | ||
;{{para|border2}}: Sets the properties of the border of the box that appears when template is expanded; defaults to <code>1px Silver</code> (there is no provision to change from a solid line). For example, <code><nowiki>{{collapse top|border2=2px}}</nowiki></code> (only width or color will be changed if only one value is supplied). See {{para|bg}}, above, for details on color options. | ;{{para|border2}}: Sets the properties of the border of the box that appears when template is expanded; defaults to <code>1px Silver</code> (there is no provision to change from a solid line). For example, <code><nowiki>{{collapse top|border2=2px}}</nowiki></code> (only width or color will be changed if only one value is supplied). See {{para|bg}}, above, for details on color options. |