Template:Collapse: Difference between revisions

From Wikipedia of the Dark Brotherhood, an online Star Wars Club
m (the documentation should make user use easier- 14185)
m (further tweaking)
 
(One intermediate revision by the same user not shown)
Line 8: Line 8:
}}; padding: 1px;"
}}; padding: 1px;"
|-
|-
! style="background-color: {{{background|{{{bg|#4B4951}}}}}}; font-size:87%; padding:0.2em 0.3em; text-align: {{{{{|safesubst:}}}#if:{{{left|}}}|left|{{{{{|safesubst:}}}#if:{{{center|}}}|center|left}}}}; {{{{{|safesubst:}}}#if:{{{fc|}}}|color: {{{fc}}};|}}" | <div style="display: inline; font-size: 115%;">{{{2|{{{title|{{{reason|{{{header|{{{heading|{{{result|Collapsed Content}}}}}}}}}}}}}}}}}}</div>
! style="background-color: {{{background|{{{bg|#4B4951}}}}}}; font-size:87%; padding:0.2em 0.3em; text-align: {{{{{|safesubst:}}}#if:{{{left|}}}|left|{{{{{|safesubst:}}}#if:{{{center|}}}|center|left}}}}; {{{{{|safesubst:}}}#if:{{{fc|}}}|color: {{{fc}}};|}}" | <div style="display: inline; font-size: 115%;">{{{2|{{{title|{{{reason|{{{header|{{{heading|{{{result|Content}}}}}}}}}}}}}}}}}}</div>
|-
|-
| style="border: solid {{{border2|1px silver}}}; padding: {{{padding|8px}}}; background-color: {{{bg2|#514A49 |}}};" |
| style="border: solid {{{border2|1px silver}}}; padding: {{{padding|8px}}}; background-color: {{{bg2|#514A49 |}}};" |
Line 20: Line 20:
=== <code>bg</code> parameter ===
=== <code>bg</code> parameter ===


The <code>bg</code> parameter is optional parameter that allows the user to change the background color.  optional. It changes the background color. Use [[Web color]] values (e.g. <code>#F0F2F5</code>).
The <code>bg</code> parameter is optional parameter that allows the user to change the background color of the header. For the desired color use the appropriate html hex values (e.g. <code>#F0F2F5</code>).
;Example:
   
<code>{<nowiki />{Collapse|1=<var>Discussion text to be put into box.</var>|bg=#453A6B}<nowiki />}</code> creates:
 
{{Collapse|1=Discussion text to be put into box.|bg=#453A6B}}
 
=== <code>bg2</code> parameter ===
 
By comparison, the <code>bg2</code> parameter will allow users to modify the background color of the body of the collapsed content. For the desired color use the appropriate html hex values (e.g. <code>#F0F2F5</code>).


;Example:
;Example:
   
   
<code>{<nowiki />{Collapse|1=<var>Discussion text to be put into box.</var>|bg=#F0F2F5}<nowiki />}</code> creates:
<code>{<nowiki />{Collapse|1=<var>Discussion text to be put into box.</var>|bg=#453A6B}<nowiki />}</code> creates:
 
{{Collapse|1=Discussion text to be put into box.|bg2=#453A6B}}


{{Collapse|1=Discussion text to be put into box.|bg=#F0F2F5}}


=== The <code>padding</code> parameter ===
=== The <code>padding</code> parameter ===

Latest revision as of 00:02, 6 August 2020

This high-risk template has been protected from editing to prevent vandalism.

Please discuss changes on the talk page. You may use editprotected on the talk page to ask for an administrator to make an edit for you.

Content
{{{1}}}


Usage

The typical use of the Collapse template is so that text can be hidden from view until it the box is expanded. There also exist a few options to modify the base box that is utilized by the Dark Brotherhood wiki.

bg parameter

The bg parameter is optional parameter that allows the user to change the background color of the header. For the desired color use the appropriate html hex values (e.g. #F0F2F5).

Example

{{Collapse|1=Discussion text to be put into box.|bg=#453A6B}} creates:


Content
Discussion text to be put into box.


bg2 parameter

By comparison, the bg2 parameter will allow users to modify the background color of the body of the collapsed content. For the desired color use the appropriate html hex values (e.g. #F0F2F5).

Example

{{Collapse|1=Discussion text to be put into box.|bg=#453A6B}} creates:


Content
Discussion text to be put into box.


The padding parameter

The padding parameter adjusts the amount of cell padding (defaults to 8px):

{{Collapse|1=Discussion text to be put into box.|padding=20px}} creates the following (expand the box to see the border padding effect):


Content
Discussion text to be put into box.


The float parameter

The float parameter allows the collapsed content to float to the left, right, or center of the page (defaults to none with width = 100%):

{{Collapse|1=Discussion text to be put into box.|float=center}} creates the following:


Content
Discussion text to be put into box.


{{Collapse|1=Discussion text to be put into box.|float=center|width=30em}} creates the following:


Content
Discussion text to be put into box.


{{Collapse|1=Discussion text to be put into box.|float=left|width=30em}} creates the following:


Content
Discussion text to be put into box.


{{Collapse|1=Discussion text to be put into box.|float=right|width=30em}} creates the following:


Content
Discussion text to be put into box.


{{Collapse|1=Discussion text to be put into box.|float=none|width=30em}} creates the following:


Content
Discussion text to be put into box.