Template:NestTextColors

From Sydapedia
Revision as of 20:29, 8 December 2007 by SydLexia (talk | contribs) (New page: <!-- Cheerfully stolen from Template:TextColors (a wikitableformat) ---><noinclude> ;This template displays an error message when not given sufficient parameters :(It needs three arguments...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
This template displays an error message when not given sufficient parameters 
(It needs three arguments min. two colors followed by text), and the error message is suppressed whilst this page is viewed directly.



This 'NestTextColors' template documentation is transcluded for all Template:NestTextColors (edit talk links history) tagged templates [edit].Masterpage  


Usage

Purpose
This template is a template work around for incompatible behaviors in Template:Fs (talk, backlinks, edit), nested in conjunction with Template:TextColors (talk, 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.Template:I5Subst 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, Template:I0use 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> 

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:Template:I0


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


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


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:Template:I0


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


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

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


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.

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


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

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