Template:Userbox
From PWI Wiki
| id | info |
|---|
Documentation[edit]
This template can be used to quickly create a userbox for display on a user's user page without having to know HTML or Wikitable syntax.
This is a slightly simplified and modified version of the Wikipedia Userbox template.
Usage[edit]
{{Userbox
| float = <!--left|right|none (default = left)-->
| border-c = <!--border color (default = #6a5d44)-->
| border-s = <!--border width in pixels (default = 1)-->
| id = <!--id image and/or text-->
| id-a = <!--id horizontal alignment left/center/right/justify (default = center)-->
| id-c = <!--id background color (default = #332f2b)-->
| id-fc = <!--id font color (default = #ffcd72)-->
| id-s = <!--id text size in points (default = 14)-->
| id-p = <!--id cell padding (default = 0 1px 0 0)-->
| id-lh = <!--id line height (default = 1.25em)-->
| id-op = <!--id other CSS parameters-->
| id-w = <!--id box width in pixels (default = 45)-->
| id-h = <!--id box height in pixels (default = 45)-->
| info = <!--info text and/or image-->
| info-a = <!--info horizontal alignment left/center/right/justify (default = left)-->
| info-c = <!--info background color (default = #171513)-->
| info-fc = <!--info font color (default = #b2b2b2)-->
| info-s = <!--info text size in points (default = 8)-->
| info-p = <!--info padding (default = 0 4px 0 4px)-->
| info-lh = <!--info line height (default = 1.25em)-->
| info-op = <!--info other CSS parameters-->
}}
- All parameters are optional
- Images should normally be scaled to x45px or less.
Most HTML-based tables use only a handful of these attributes. The following subset can be used to quickly convert an HTML userbox into the format used here:
{{Userbox
| border-c = <!--your border color-->
| id = <!--your icon or short text ID-->
| id-c = <!--background color for ID-->
| id-fc = <!--font color for ID-->
| info = <!--your text-->
| info-c = <!--background color for text-->
| info-fc = <!--font color for text-->
}}
Standard colors:
- Blue: #1e90ff
- Red: #b22222
- Orange: #f28500
- Yellow: #f4c430
- Purple: #9932cc
- Gold: #b49b50
Examples[edit]
| Code | Result | ||
|---|---|---|---|
{{Userbox}} |
| ||
| Below example shows how an image may be substituted for text. The Image parameter takes the filename, display size, and alt-text (seen when you hover your mouse over the image). | |||
{{Userbox
| id = [[Image:TigerSmileySet.png|
45px|Tiger Smiley]]
| info = ''foo bar''
| info-s = 12
| border-s = 2
}} |
| ||
| Below example shows the default appearance of a userbox, which is (much) higher than the 45px. Compare the height of the one below with the above userbox. | |||
{{Userbox
| id = foo logo
| info = ''We are trying to see
default distance in between text
lines, and, see the distance in
between cell content and its border
and also see total height.''
| border-s = 2
}} |
| ||
| Below example shows how we can change that userbox and further specify parameters to bring down the overall height of the userbox to the recommended height of 45px, even with four text lines. Cell padding parameter "info-p" can also be set at "1pt 1pt 1pt 2pt", or "1pt 2pt" for better appearance, when there are 4 text lines. | |||
{{Userbox
| id = foo logo
| id-s = 14
| id-lh = 1.1em
| info = ''We have specified values
to lessen the distance in between
text lines & padding space in between
cell content and its border.''
| info-s = 8
| info-p = 1pt
| info-lh = 1.05em
| border-s = 1
}} |
| ||