Template:NestTextColors/doc

From Wikipedia, the free encyclopedia

This is a documentation subpage for Template:NestTextColors (see that page for the template itself).
It contains usage information, categories and other content that is not part of the original template page.


Similar templates at English sister projects [edit]
mta Meta-wiki NestTextColors/doc
wpd Wikipedia NestTextColors/doc
cms Commons NestTextColors/doc
wbk Wikibooks NestTextColors/doc
wsp Wikispecies NestTextColors/doc
wvy Wikiversity NestTextColors/doc

Contents

[edit] Usage

Purpose
This template is a template work around for incompatible behaviors in Template:Fs (backlinks, edit), nested in conjunction with Template:TextColors (backlinks, edit) (A wikitable delimited form, used to develop this 'div style' version).
where parameter "|border=various"
... allows a variety of add on style effects, such as padding and borders —-- normal legal HTML inside 'div style' blocks.
wherein arguments #'s


   (1) and (2) — Set foreground and background colors of the given block of text respectfully. They can be specified by name or in the format #dddddd (RGB hex triplet).
   (3) — is the text to be displayed inside a colorized block, ommision of which leaves the 'bright' error message shown above. In general, most other templates will work within this field. However, some may not parse properly due to template nesting arcana.
   (4) — is the optional div block width perameter. (default is full width, or 100%)
   (5) — is an optional Font Size perameter. (default is very small, or Font Size 1)

Cautions
  • One can include templates and links within, but templates with a 'define perameter' section using an equals sign will break during parsing the template.
         Subst the desired content first instead, and enclose that.
  • The message data must be one continuous unbroken line-- do not include newlines in the text.
  • Unless in the case of personal use on a user page,


use this template with great caution:

    • a poor contrast may make the text difficult or impossible to read
    • the contrast can be experienced as even poorer in the case of color blindness
    • links have a color according to user settings; they become invisible if this color is equal to the background color


Template guts
( '//' means manually wrapped for clarity)

<font size={{{5|3}}}>
  // <div style="color:{{{1|red}}}; background:{{{2|yellow}}}; 
  // width:{{{4|100}}}%; {{{border|}}};">
  // {{{3|Error: message.}}}</div></font> 

[edit] Examples

ex-1) Using default width, and {{I}} to define line wrapping:

   {{NestTextColors|#000000|#ffffff|From [[Wikipedia]], the free [[encyclopedia]]. (black on white, 100% width, medium font size,{{I}}[Note the missing fourth perameter,defaults to 100% width --->] --->)||3}} gives:


ex-2) {{NestTextColors|#aa0000|#009999|From [[Wikipedia]], the free [[encyclopedia]]. (A red hue on 50%, small font)|50}} gives:


ex-3) {{NestTextColors|Green|cyan|From [[Wikipedia]], the free [[encyclopedia]]. (Green on Cyan, 75% width, medium small font size) |75|2}} gives:


ex-4) <div style="float:right">{{NestTextColors|yellow|grey|From [[Wikipedia]], the free [[encyclopedia]]. (Yellow on Grey, 75%, Medium-large font size) |75|4}}</div> gives:



ex-5) {{NestTextColors|blue|silver|From [[Wikipedia]], the free [[encyclopedia]].|25|5}} gives:


ex-6) <center>{{NestTextColors|grey|yellow|From [[Wikipedia]], the free [[encyclopedia]].|50|3}}</center> gives:


ex-7) <div style="float:right">{{NestTextColors|black|aqua|From [[Wikipedia]], the free [[encyclopedia]].|35|3}}</div> gives:



Users are cautioned
that browser font sizes and rendering may differ significantly between browsers, and are urged to check the resultant effects on using this template on both IE6 and non-IE6 browsers.

[edit] Standard color names

The HTML 4.01 specification defines sixteen named colors, as follows:

Color Hexadecimal Color Hexadecimal
black #000000 silver #c0c0c0
gray #808080 white #ffffff
maroon #800000 red #ff0000
purple #800080 fuchsia #ff00ff
green #008000 lime #00ff00
olive #808000 yellow #ffff00
navy #000080 blue #0000ff
teal #008080 aqua #00ffff


[edit] See also

  • {{Colors}} – background/text color (text in free span)
  • {{TextColors}} – background/text color (text in block table)
  • {{NestTextColors}} – background/text color (text in block div)
  • {{bkg}} – background color (text in free span)
  • {{bg}} – background color (text in free span)

and