Template:Comment-box1

From Iron Chariots Wiki
(Difference between revisions)
Jump to: navigation, search
(Rounded corners also in Safari)
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
__NOTOC__<div style="align: center; width: {{{width|auto}}}; background: {{{bg|#FFF7D2}}}; color: {{{tcolor| }}} padding: 0 0 0 1em; margin: .5em {{{rmargin|1em}}} 1em {{{lmargin|1em}}}; border: {{{border|1px solid #777}}}">
+
<div style=" -moz-border-radius: 3px; -webkit-border-radius: 3px; border-radius: 3px; align: center; width: {{{width|auto}}}; background: {{{bg|#FFF7D2}}}; color: {{{tcolor|#000 }}}; padding: 0 .5em 0 1em; margin: .5em {{{rmargin|1em}}} 1em {{{lmargin|1em}}}; border: {{{border|1px solid #aa7}}}">
'''{{{label| }}}''' {{{text}}}
+
{{if|test={{{label|}}}|then='''{{{label|}}}'''&#160;|else=}}{{{text}}}
</div>
+
</div><noinclude>{{doc}}
  
<noinclude>
+
[[Category:Informational templates|Comment-box1]]
<br style="clear:both" />
+
==Usage==
+
<nowiki>{{</nowiki>Comment-box1|'''width'''=''setting''(optional)|'''bg'''=''color''(optional)|'''tcolor'''=''color''(optional)|'''rmargin'''=''xx''(optional)|'''lmargin'''=''xx''(optional)|'''border'''=''xx''(optional)|'''label'''=''label''(optional)|'''text'''=Sample text...('''required''')<nowiki>}}</nowiki>
+
==Parameters==
+
===Optional===
+
'''width''' &rarr; Sets width of box. Accepts any valid CSS width value
+
:<nowiki>[</nowiki>Numerical values with 'px' or 'em' designators or auto(default).<nowiki>]</nowiki>
+
'''bg''' &rarr; Sets background color of box. Accepts any valid CSS background value
+
:<nowiki>[</nowiki>Hexadecimal values (preceded by #, as in '''#FAF''' or '''#E3F6A1'''), RGB values (formatted as RGB(x,x,x) as in '''RGB(128,5,112)''') or color names (as in '''red''' or '''lightgreen''').<nowiki>]</nowiki>
+
'''tcolor''' &rarr; Sets text color of content. Accepts any valid CSS background value
+
:<nowiki>[</nowiki>Hexadecimal values (preceded by #, as in '''#FAF''' or '''#E3F6A1'''), RGB values (formatted as RGB(x,x,x) as in '''RGB(128,5,112)''') or color names (as in '''red''' or '''lightgreen''').<nowiki>]</nowiki>
+
'''rmargin''' &rarr; Sets right margin. Accepts any valid CSS margin value
+
:<nowiki>[</nowiki>Numerical values with 'px' or 'em' designators or 0 (default is 1em).<nowiki>]</nowiki>
+
'''lmargin''' &rarr; Sets left margin Accepts any valid CSS margin value
+
:<nowiki>[</nowiki>Numerical values with 'px' or 'em' designators or 0 (default is 1em).<nowiki>]</nowiki>
+
'''border''' &rarr; Defines border attributes. Accepts any valid CSS border description
+
:<nowiki>[</nowiki>Descriptions as '''1px solid #777''' or '''dashed'''<nowiki>]</nowiki>
+
'''label''' &rarr; Sets the label (if any). This label precedes the text and appears in bold
+
===Required===
+
'''text''' &rarr; The content to be displayed.
+
==Samples==
+
*<nowiki>{{Comment-box1|width=75%|bg=lightgreen|label=Comment:|text=Here's some sample text.}}</nowiki> yields:
+
{{Comment-box1|width=75%|bg=lightgreen|label=Comment: |text=Here's some sample text.}}
+
*<nowiki>{{Comment-box1|rmargin=200px|lmargin=75px|label=Message:|text=Here's some sample text.}}</nowiki> yields:
+
{{Comment-box1|rmargin=200px|lmargin=75px|label=Message:|text=Here's some sample text.}}
+
*<nowiki>{{Comment-box1|width=300px|bg=rgb(188,206,188)|border=5px dotted #3333E4|text=Here's some sample text.|label=Recipe:}}</nowiki> yields:
+
{{Comment-box1|width=300px|bg=rgb(188,206,188)|border=5px dotted #3333E4|text=Here's some sample text.|label=Recipe:}}
+
*<nowiki>{{Comment-box1|bg=#DDF|text=Here's some sample text.}}</nowiki> yields:
+
{{Comment-box1|bg=#DDF|text=Here's some sample text.}}
+
*<nowiki>{{Comment-box1|bg=#000|tcolor=#FFF|text=Here's some sample text.}}</nowiki> yields:
+
{{Comment-box1|bg=#000|tcolor=#FFF|text=Here's some sample text.}}
+
 
</noinclude>
 
</noinclude>

Latest revision as of 19:44, 7 September 2009

{{{text}}}

The documentation for this template is transcluded from Template:Comment-box1/doc. Please edit that page if you want to change something in the documentation. Do not edit this page unless you know what you're doing.
Purpose
To provide consistent formatting of comment boxes in articles (or other types of pages, as necessary).
Usage
{{Comment-box1|text=Text}}
{{Comment-box1|label=label|text=Text}}
{{Comment-box1|...parameters...|text=Text}}
Notes
  • The named parameter text is required; its value, Text, is the text that will be displayed in the box. Text can contain line breaks (newlines) and wiki formatting.
  • The named parameter label is optional; its value, if present, will appear in bold type immediately before the comment text (include a trailing colon in Label if you want to see one).
  • The additional optional parameters control different CSS style attributes. Note that colors may be specified by a hex triplet (e.g., #FFDDCC or #fdc for short — the differences in capitalization are not meaningful), an RGB triplet (e.g., RGB(255,221,204)), or a valid color name (e.g., salmon — not quite the same color as the previous two mentioned in this note). See Wikipedia:Web colors for help with specifying colors. Lengths and widths can be specified using relative units such as em ("M" width) or % (percent), or absolute units such as px (pixels). When specifying a zero length or width, use 0 with no units.
  • The optional parameters include:
    width=width
    Width of the box. Please use relative units (see note above). The special value auto (which is the default) will make the box only as wide as it needs to be.
    border=border_properties
    Border properties. Generally this consists of a space-separated list of line width, line type, and line color. The default is 1px solid #777.
    bg=background_properties
    Properties of the background (behind the visible text). Usually this only specifies the color, although other options are available. The default is #FFF7D2.
    tcolor=text_color
    Text color. The default is #000.
    rmargin=right_margin
    Right margin (space between text and right border of box). Please use relative units (see note above). The default is 1em.
    lmargin=left_margin
    Left margin (space between text and left border). Please use relative units (see note above). The default is 1em.
Examples
  • {{Comment-box1|bg=darkred|tcolor=white|border=3px solid black|label=WARNING:|text=Setting incompatible values for '''width''' and '''rmargin/lmargin''' may have unexpected results. '''Preview''' pages before saving.}}

WARNING: Setting incompatible values for width and rmargin/lmargin may have unexpected results. Preview pages before saving.

  • {{Comment-box1|width=75%|bg=lightgreen|label=Comment:|text=Here's some sample text.}} yields:

Comment: Here's some sample text.

  • {{Comment-box1|rmargin=200px|lmargin=75px|label=Message:|text=Here's some sample text.}} yields:

Message: Here's some sample text.

  • {{Comment-box1|width=300px|bg=rgb(188,206,188)|border=5px dotted #3333E4|text=Here's some sample text.|label=Recipe:}} yields:

Recipe: Here's some sample text.

  • {{Comment-box1|bg=#DDF|text=Here's some sample text.}} yields:

Here's some sample text.

  • {{Comment-box1|bg=#000|tcolor=#FFF|text=Here's '''some''' sample ''text'', with formatting.}} yields:

Here's some sample text, with formatting.

Personal tools
Namespaces
Variants
Actions
wiki navigation
IronChariots.Org
Toolbox