|
|
Line 1: |
Line 1: |
| <span style="background: {{{2}}}; color: {{{1}}}">{{{3}}}</span><noinclude> | | <span style="background: {{{2}}}; color: {{{1}}}">{{{3}}}</span><noinclude> |
- | {{interwikitmp-grp|V=3}}
| + | ---- |
- | ==Usage== | + | === Usage === |
- | Guts:
| + | Gives text a foreground and background color. Both are CSS values. |
- | '''<nowiki><span style="background: {{{2}}}; color: {{{1}}}">{{{3}}}</span></nowiki>'''
| + | |
| | | |
- | Sets foreground and background [[web colors|colors]] of a given text. They can be specified by name or in the format #dddddd (RGB hex triplet).
| + | <code><nowiki>{{colors|foreground|background|text}}</nowiki></code> |
| | | |
- | Unless in the case of personal use on a user page, use this template with great caution:
| + | [[Category:Formatting Templates|{{PAGENAME}}]] |
- | *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.
| + | |
- | | + | |
- | ==See also ==
| + | |
- | | + | |
- | * {{tl|Colors}} – background/text color (text in free span)
| + | |
- | * {{tl|TextColors}} – background/text color (text in block table)
| + | |
- | * {{tl|NestTextColors}} – background/text color (text in block div)
| + | |
- | * {{tl|bkg}} – background color (text in free span)
| + | |
- | * {{tl|bg}} – background color (text in free span)
| + | |
- | | + | |
- | ==Examples==
| + | |
- | | + | |
- | <nowiki>{{colors|#ffffff|#000000|From [[Wikipedia]], the free [[encyclopedia]].}}</nowiki> gives: {{colors|#ffffff|#000000|From [[Wikipedia]], the free [[encyclopedia]].}}
| + | |
- | | + | |
- | <nowiki>{{colors|#aa0000|#009999|From [[Wikipedia]], the free [[encyclopedia]].}}</nowiki> gives: {{colors|#aa0000|#009999|From [[Wikipedia]], the free [[encyclopedia]].}}
| + | |
- | | + | |
- | <nowiki>{{colors|white|black|From [[Wikipedia]], the free [[encyclopedia]].}}</nowiki> gives: {{colors|white|black|From [[Wikipedia]], the free [[encyclopedia]].}}
| + | |
- | | + | |
- | <nowiki>{{colors|yellow|grey|From [[Wikipedia]], the free [[encyclopedia]].}}</nowiki> gives: {{colors|yellow|grey|From [[Wikipedia]], the free [[encyclopedia]].}}
| + | |
- | | + | |
- | <nowiki>{{colors|blue|silver|From [[Wikipedia]], the free [[encyclopedia]].}}</nowiki> gives: {{colors|blue|silver|From [[Wikipedia]], the free [[encyclopedia]].}}
| + | |
- | | + | |
- | <nowiki>{{colors|grey|yellow|From [[Wikipedia]], the free [[encyclopedia]].}}</nowiki> gives: {{colors|grey|yellow|From [[Wikipedia]], the free [[encyclopedia]].}}
| + | |
- | | + | |
- | <nowiki>{{colors|black|aqua|From [[Wikipedia]], the free [[encyclopedia]].}}</nowiki> gives: {{colors|black|aqua|From [[Wikipedia]], the free [[encyclopedia]].}}
| + | |
- | | + | |
- | == Standard color names ==
| + | |
- | | + | |
- | The [[HTML]] 4.01 specification defines sixteen named colors, as follows:
| + | |
- | | + | |
- | {| border="0"
| + | |
- | !Color
| + | |
- | !Hexadecimal
| + | |
- | !Color
| + | |
- | !Hexadecimal
| + | |
- | |-
| + | |
- | |black
| + | |
- | |style="background:#000000; color:#ffffff; font-family:monospace;"|#000000
| + | |
- | |silver
| + | |
- | |style="background:#c0c0c0; color:#000000; font-family:monospace;"|#c0c0c0
| + | |
- | |-
| + | |
- | |gray
| + | |
- | |style="background:#808080; color:#ffffff; font-family:monospace;"|#808080
| + | |
- | |white
| + | |
- | |style="background:#ffffff; color:#000000; font-family:monospace;"|#ffffff
| + | |
- | |-
| + | |
- | |maroon
| + | |
- | |style="background:#800000; color:#ffffff; font-family:monospace;"|#800000
| + | |
- | |red
| + | |
- | |style="background:#ff0000; color:#000000; font-family:monospace;"|#ff0000
| + | |
- | |-
| + | |
- | |purple
| + | |
- | |style="background:#800080; color:#ffffff; font-family:monospace;"|#800080
| + | |
- | |fuchsia
| + | |
- | |style="background:#ff00ff; color:#000000; font-family:monospace;"|#ff00ff
| + | |
- | |-
| + | |
- | |green
| + | |
- | |style="background:#008000; color:#ffffff; font-family:monospace;"|#008000
| + | |
- | |lime
| + | |
- | |style="background:#00ff00; color:#000000; font-family:monospace;"|#00ff00
| + | |
- | |-
| + | |
- | |olive
| + | |
- | |style="background:#808000; color:#ffffff; font-family:monospace;"|#808000
| + | |
- | |yellow
| + | |
- | |style="background:#ffff00; color:#000000; font-family:monospace;"|#ffff00
| + | |
- | |-
| + | |
- | |navy
| + | |
- | |style="background:#000080; color:#ffffff; font-family:monospace;"|#000080
| + | |
- | |blue
| + | |
- | |style="background:#0000ff; color:#000000; font-family:monospace;"|#0000ff
| + | |
- | |-
| + | |
- | |teal
| + | |
- | |style="background:#008080; color:#ffffff; font-family:monospace;"|#008080
| + | |
- | |aqua
| + | |
- | |style="background:#00ffff; color:#000000; font-family:monospace;"|#00ffff
| + | |
- | |}
| + | |
- | | + | |
- | See also:
| + | |
- | *[[web colors]]
| + | |
- | *{{tiw|Fontcolor}}
| + | |
- | *[http://lynda.com/hex.asp# non-dithering safe colors]
| + | |
- | [[Category:Formatting Templates|{{PAGENAME}} ]]<!--- Keep for compatibility with en.wp ----> | + | |
| </noinclude> | | </noinclude> |
Gives text a foreground and background color. Both are CSS values.