Template:UserTemplate: Difference between revisions
From The Urban Dead Wiki
Jump to navigationJump to search
The Rooster (talk | contribs) (Corrected and redefined some CSS, and tided documentation) |
The Rooster (talk | contribs) m (default font-size redefined to absolute CSS values to prevent font scaling when nested) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
{|style="margin:{{{margintopbottom|auto}}} {{{marginleftright|0}}};border:{{{borderwidth|2px}}} {{{borderstyle|solid}}} {{{bordercolor|black}}};width:{{{width|250px}}};padding:{{{padding|0}}};background:{{{background|white}}};font-size:{{{fontsize|medium}}}" | {|style="margin:{{{margintopbottom|auto}}} {{{marginleftright|0}}};border:{{{borderwidth|2px}}} {{{borderstyle|solid}}} {{{bordercolor|black}}};width:{{{width|250px}}};padding:{{{padding|0}}};background:{{{background|white}}};font-size:{{{fontsize|medium}}}" | ||
|rowspan=2 style="padding:{{{imagepadding|0}}}"|[[Image:{{{image|Example.jpg}}}|{{{imagewidth|60px}}}]] | |rowspan=2 style="padding:{{{imagepadding|0}}}"|[[Image:{{{image|Example.jpg}}}|{{{imagewidth|60px}}}]] | ||
|style="background:{{{headerbackground|black}}};color:{{{headercolor|white}}};font-size:{{{headerfontsize| | |style="background:{{{headerbackground|black}}};color:{{{headercolor|white}}};font-size:{{{headerfontsize|small}}};line-height:{{{headerlineheight|1.5}}};text-align:{{{headeralign|center}}};height: {{{headerheight|auto}}};width:100%"|{{{headertext}}} | ||
|- | |- | ||
|style="font-size:{{{mainfontsize| | |style="font-size:{{{mainfontsize|xx-small}}};text-align:{{{mainalign|center}}};line-height:{{{mainlineheight|2}}};background:{{{mainbackground|transparent}}};color:{{{maincolor|black}}};padding:{{{mainpadding|0}}}"|{{{maintext}}} | ||
|}<noinclude> | |}<noinclude> | ||
==Usage== | ==Usage== | ||
Line 63: | Line 63: | ||
*''headerbackground:'' black | *''headerbackground:'' black | ||
*''headercolor:'' white | *''headercolor:'' white | ||
*''headerfontsize:'' | *''headerfontsize:'' small | ||
*''headerlineheight:'' 1.5 | *''headerlineheight:'' 1.5 | ||
*''headeralign:'' center | *''headeralign:'' center | ||
*''headerheight:'' auto | *''headerheight:'' auto | ||
*''mainfontsize:'' | *''mainfontsize:'' xx-small | ||
*''mainalign:'' center | *''mainalign:'' center | ||
*''mainlineheight:'' 2 | *''mainlineheight:'' 2 | ||
Line 80: | Line 80: | ||
<nowiki>{{UserTemplate|headertext='''My First Template'''|maintext=This is my first template!|image=Dead.gif}}</nowiki> | <nowiki>{{UserTemplate|headertext='''My First Template'''|maintext=This is my first template!|image=Dead.gif}}</nowiki> | ||
[[Category: | [[Category:Userboxes| {{PAGENAME}}]]</noinclude> |
Latest revision as of 19:56, 2 March 2010
{{{headertext}}} | |
{{{maintext}}} |
Usage
{{UserTemplate |margintopbottom=size |marginleftright=size |borderwidth=size |borderstyle=style |bordercolor=color |width=size |padding=size |background=color |fontsize=size |imagepadding=size |image=name |imagewidth=size |headerbackground=color |headercolor=color |headerfontsize=size |headerlineheight=size |headeralign=alignment |headerheight=size |headertext=text |mainfontsize=size |mainalign=alignment |mainlineheight=size |mainbackground=color |maincolor=color |mainpadding=size |maintext=text }}
This template is the mother of all user box templates. You need only define a few variables to get it to function. But you can adjust others for fine tuning of the result.
You must define:
- image: image filename
- headertext: text in the header
- maintext: text in the main body
You should probably define:
- bordercolor: color of the border
- headerbackground: color of the header
- headercolor: color of the header text
The defaults are:
- margintopbottom: auto
- marginleftright: 0
- borderwidth: 2px
- borderstyle: solid
- bordercolor: black
- width: 250px
- padding: 0
- background: white
- fontsize: medium
- imagepadding: 0
- imagewidth: 60px
- headerbackground: black
- headercolor: white
- headerfontsize: small
- headerlineheight: 1.5
- headeralign: center
- headerheight: auto
- mainfontsize: xx-small
- mainalign: center
- mainlineheight: 2
- mainbackground: transparent
- maincolor: black
- mainpadding: 0
Example
To create
My First Template | |
This is my first template! |
just type
{{UserTemplate|headertext='''My First Template'''|maintext=This is my first template!|image=Dead.gif}}