• Home
  • Random
  • Recent changes
  • Special pages
  • Settings
  • About MOASSpedia
  • Disclaimers
MOASSpedia
  • 216.73.216.55
  • Talk
  • Watchlist
  • Contributions
  • Log in

Template:Color block

Template Discussion
  • Language
  • Watch
  • History
  • Edit
    • Page information
    • Permanent link
    • What links here
Template documentation[view] [edit] [history] [purge]

Contents

  • 1 Color block template
    • 1.1 Using a CSS color keyword
    • 1.2 Using a CSS HEX color value
    • 1.3 Using a custom name
      • 1.3.1 Color tooltip
    • 1.4 Bold type
  • 2 External links

Color block template

This template can be used to display a color block and its associated CSS color name / HEX value.

Using a CSS color keyword

Example:

{{Color block|red}}

Output: █

Using a CSS HEX color value

Note: A HEX color value must be prefixed by the "#" character.

Example:

{{Color block|#FF00FF}}

Output: █

Using a custom name

You may specify a custom color name to be displayed, instead of the CSS keyword or HEX value.

Example:

{{Color block|#ffbf00|Amber}}

Output: █Amber

Color tooltip

If you have specified a custom color, then you can use color-tooltip=1 to show a tooltip for the CSS color name / HEX color value. If you are accessing Wikipedia through a PC, then you can hover the mouse to see this tooltip.

Example:

{{Color block|#ffbf00|Amber|color-tooltip=1}}

Output: █Amber

Bold type

You may use the bold=1 parameter to show the text in bold type.


Example:

{{Color block|green|bold=1}}

Output: █


Example:

{{Color block|#0000ff|bold=1}}

Output: █


Example:

{{Color block|#ffbf00|Amber|bold=1}}

Output: █Amber


Example:

{{Color block|#ffbf00|Amber|bold=1|color-tooltip=1}}

Output: █Amber

External links

  • CSS color names:W3 CSS color names
The above documentation is transcluded from Template:Color block/doc. (edit | history)
Editors can experiment in this template's sandbox (create | mirror) and testcases (create) pages.
Add categories to the /doc subpage. Subpages of this template.
Retrieved from "https://moasspedia.org/w/index.php?title=Template:Color_block&oldid=9371"
Category:
  • Wikipedia formatting and function templates
Last edited on 17 November 2020, at 18:30

MOASSpedia

Content is available under Creative Commons Attribution-ShareAlike unless otherwise noted.
  • This page was last edited on 17 November 2020, at 18:30.
  • Content is available under Creative Commons Attribution-ShareAlike unless otherwise noted.
  • Privacy policy
  • About MOASSpedia
  • Disclaimers
  • Desktop