Template:Legend striped

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
Template documentationview · edit · history · purge ]
This documentation is transcluded from Template:Legend striped/doc.

Shows a legend row with a two colored box. Complimentary to the one color legend template. To achieve a similar effect without highlighting the text, see Template:Legend sliced.

Usage

[edit]
{{Legend striped|top color|bottom color|label|outline=outline color|border=css border}}
  • top color and bottom color are passed to the css background-color property of the color box. These fields are required.
  • label is optional, and adds text to the right of the box. Text may be '''bold''' or ''italic'' also.
  • The optional outline parameter is the color of the outline around the box.
  • If you need to customize the border further, you can use the border argument, which overrides the outline argument and sets the css description (e.g., 1px solid #aaa) of the border that will be drawn around the box.

Additionally, editors can specify several other optional fields:

  • size: sizes should be in terms of em, px, or pt. 1.5em is the default.
  • up: will make the diagonal line go from bottom left to top right. The default is top left to bottom right.
  • text: will put one or two characters of text inside the box. If using one character, a non-breaking space ( ) will help center it. The color of this text may also be specified with the field textcolor. Will not work with up field.

Examples

[edit]

Typical use

[edit]
{{Legend striped|black|gray|Raiders}}
{{Legend striped|green|gold|Packers}}
{{Legend striped|purple|black|''Ravens''|up=yes}}
{{Legend striped|#003b7b|#fff|Colts|outline=silver}}
{{Legend striped|#c80815|#e6be8a|'''49ers'''|border=2px solid black}}
  Raiders
  Packers
  Ravens
  Colts
  49ers

Advanced use

[edit]
{{ Legend striped#0c2340#a2aaadsize = 2emborder = 3px solid #78be20Seahawks }}
  Seahawks
{{ Legend stripedwhitegoldborder3px solid maroon =  Rtext = maroontextcolor = Washington }}
  R Washington

Larger squares and rects

[edit]
{{ Legend striped#F00#0F0width = 2emheight = 1.5emborder = none }}
  
{{ Legend striped#00B#000width = 60pxsize = 45pxborder = 1px solid gold }}
  

{{ Legend striped#F00#FF0width = 160pxsize = 32pxborder = 1px solid #666up = yes }}

  

Compatibility

[edit]

Current compatibility issues are based on different browsers implementation of CSS protocol. These boxes, for example, may look too tall on mobile browsers. Please let the developers know on the talk page if there are issues.