Наши волонтёры ещё не перевели данную статью на Русский. Присоединяйтесь к нам и помогите сделать эту работу!
Вы можете также прочитать эту статью на English (US).

Non-standard
This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

Obsolete since Gecko 59 (Firefox 59 / Thunderbird 59 / SeaMonkey 2.56)
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

In Mozilla applications like Firefox, the -moz-border-left-colors CSS property sets a list of colors for the left border.

/* Single <color> value */
-moz-border-left-colors: #f0f0f0;

/* Multiple <color> values */
-moz-border-left-colors: #f0f0f0 #a0a0a0 #505050 #000000;

/* Global values */
-moz-border-left-colors: inherit;
-moz-border-left-colors: initial;
-moz-border-left-colors: unset;

When an element has a border that is larger than a single CSS pixel, each line of pixels uses the next color specified in this property, from the outside in. This eliminates the need for nested boxes. If the border is wider than the number of specified colors, the remaining part of the border is the innermost color specified.

Initial valuenone
Applies toall elements
Inheritedno
Mediavisual
Computed valueas specified
Animation typediscrete
Canonical orderthe unique non-ambiguous order defined by the formal grammar

It does not apply

  1. if border-style is dashed or dotted.
  2. to tables with border-collapse: collapse.

Syntax

Values

Accepts a white-space separated list of color values.

<color>
Specifies the color of a line of pixels of the left border. transparent is valid. See <color> values for possible units.
none
Default, no colors are drawn or border-color is used, if specified.

Formal syntax

<color>+ | none

where
<color> = <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>

where
<rgb()> = rgb( <percentage>{3} [ / <alpha-value> ]? ) | rgb( <number>{3} [ / <alpha-value> ]? ) | rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? )
<rgba()> = rgba( <percentage>{3} [ / <alpha-value> ]? ) | rgba( <number>{3} [ / <alpha-value> ]? ) | rgba( <percentage>#{3} , <alpha-value>? ) | rgba( <number>#{3} , <alpha-value>? )
<hsl()> = hsl( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsl( <hue>, <percentage>, <percentage>, <alpha-value>? )
<hsla()> = hsla( <hue> <percentage> <percentage> [ / <alpha-value> ]? ) | hsla( <hue>, <percentage>, <percentage>, <alpha-value>? )

where
<alpha-value> = <number> | <percentage>
<hue> = <number> | <angle>

Example

<div id="example">Example</div>
#example {
  padding: 20px;
  background-color: gray;
  border: 10px solid black;
  -moz-border-top-colors: #e00 #c30 #c50 #c60 #c70 #c80 #c90 #ca0 #cb0 #cc0;
  -moz-border-right-colors: red #f60 #f80 #f90 #fa0 #fb0 #fc0 #fd0 #fe0 #ff0;
  -moz-border-bottom-colors: red #f60 #f80 #f90 #fa0 #fb0 #fc0 #fd0 #fe0 #ff0;
  -moz-border-left-colors: #e00 #c30 #c50 #c60 #c70 #c80 #c90 #ca0 #cb0 #cc0;
}

Specifications

This property is not part of any specification.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic support
Non-standard
Chrome No support NoEdge No support NoFirefox No support 1 — 59
Notes
No support 1 — 59
Notes
Notes In Firefox 59, the property was limited to usage in chrome code only (See bug 1417200).
Notes In Firefox 60, the property was removed completely (See bug 1429723).
IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoEdge Mobile No support NoFirefox Android No support 4 — 59
Notes
No support 4 — 59
Notes
Notes In Firefox 59, the property was limited to usage in chrome code only (See bug 1417200).
Notes In Firefox 60, the property was removed completely (See bug 1429723).
Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No

Legend

No support  
No support
Non-standard. Expect poor cross-browser support.
Non-standard. Expect poor cross-browser support.
See implementation notes.
See implementation notes.

See also

Метки документа и участники

Внесли вклад в эту страницу: teoli, ExE-Boss, mfuji09, chrisdavidmills, fscholz, mfluehr, wbamberg, Sebastianz, Sheppy, Jürgen Jeka, Marsf, Fredchat, Mgjbot, Spanglerco
Обновлялась последний раз: teoli,