Help:Userbox: Difference between revisions

(see below doesn't work for now)
Line 15: Line 15:
==Contents of a Userbox==
==Contents of a Userbox==


[[Image:Userboxexample.jpg|left]]
[[Image:Userboxexample.jpg|left]]<br><br><br><br><br><br>
 
Code = <tt><nowiki>{{userbox|border=#FF0000|mainbkgd=#FF5555|codebkgd=#FF0000|codecolor=#000000|code=vg-5|msg=This user is a professional gamer.}}</nowiki></tt>


#The ''border color'' sets what it says.
#The ''border color'' sets what it says.
Line 27: Line 25:


The four six-alphanumeric codes above are hex decimal colors. The maincolor is automatically black, but can be changed using <nowiki><span></nowiki> tags.
The four six-alphanumeric codes above are hex decimal colors. The maincolor is automatically black, but can be changed using <nowiki><span></nowiki> tags.
==Code of a Userbox==
The code of the ''vg-5'' userbox above was <tt><nowiki>{{userbox|border=#FF0000|mainbkgd=#FF5555|codebkgd=#FF0000|codecolor=#000000|code=vg-5|msg=This user is a professional gamer.}}</nowiki></tt>. As revealed by the two squiggly brackets, the code is a [[Template:Userbox|template]]. There is also a [[Template:Userboxtop|top]] and a [[Template:Userboxbottom|bottom]] template to add inbetween the userboxes, completing the Userbox Tower. The code of these templates, one at a time:
''Userboxtop''
<tt><nowiki>{| name="userboxes" id="userboxes" style="float: right; margin-left: 1em; margin-bottom: 1ex; width: 242px; border: 1px solid #99B3FF; clear: right"
|-
| style="text-align: center" | '''[[MarioWiki:Userbox|Userbox Tower]]'''
|-
|</nowiki></tt>
This part opens up a table, aligned to the right, with the header "Userbox Tower" (linking to the Userbox page). It sets up the main code...
''Userbox''
<tt><nowiki>|-
|<div style="float: left; border:solid {{{border}}} 1px; margin: 1px;">
{| cellspacing="0" style="width: 238px; background: {{{mainbkgd}}};"
| style="width: 45px; height: 45px; background: {{{codebkgd}}}; text-align: center; font-size: 14pt; font-family: Arial; color: {{{codecolor}}}" | {{{code}}}
| style="font-size:8pt;font-family:Arial;padding:4pt;line-height:1.25em;" class="plainlinks" | {{{msg}}}
|}
</div></nowiki></tt>
If you've been reading this tutorial, the words inbetween the three squiggly brackets (not two), you should be understanding how it works now. Those six IDs are variables that can be changed for each userbox, by specificing <tt>ID=_____</tt> each time, inbetween <tt>|</tt>s. The hex colors require a # before the six characters. There can be as many userboxes as you want, and they will be "stacked" on top of one another in the right-hand table going down, hence where the name ''Userbox Tower'' came from. Each userbox is an individual table inside of a whole tower table.
''Userboxbottom''
<tt>|}</tt>
Yes, you're reading everything right. Though you can just as easily type <tt>|}</tt>, using <nowiki>{{userboxbottom}}</nowiki> denotes the end of the userbox on your user page, making it easier to navigate. The sole purpose of the code itself is to close the Tower table from the <nowiki>{{userboxtop}}</nowiki>.
10,241

edits