border-left-color

  • Revision slug: CSS/border-left-color
  • Revision title: border-left-color
  • Revision id: 354779
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment

Revision Content

{{ CSSRef() }}

Summary

The border-left-color CSS property sets the color of the bottom border of an element. Note that in many cases the shorthand CSS properties {{ cssxref("border-color") }} or {{ cssxref("border-left") }} are more convenient and preferable.

  • {{ Xref_cssinitial() }} {{ cssinitial("border-left-color") }}, the element's {{ Cssxref("color") }} property's value
  • Applies to all elements
  • {{ Xref_cssinherited() }} no
  • Media {{ Xref_cssvisual() }}
  • {{ Xref_csscomputed() }} the computed color

Syntax

Formal syntax: {{csssyntax("border-left-color")}}
border-left-color: color

border-left-color: inherit

Values

color
Is a {{ Xref_csscolorvalue() }} CSS value describing the color of the left border.
inherit
Is a keyword denoting the color of the bottom border of the parent's element (which may be different from the border-left-color default value)

Examples

pre {
    border: solid 0.3em gold;
    border-left-color: red;
}
/* this has the same result:
pre {
        border: solid 0.3em;
        border-color: gold gold gold red; 
} */

Specifications

Specification Status Comment
{{ SpecName('CSS3 Backgrounds', '#border-left-color', 'border-left-color') }} {{ Spec2('CSS3 Backgrounds') }} No significant changes, though the transparent keyword, now included in {{ xref_csscolorvalue() }} which has been extended, has been formally removed.
{{ SpecName('CSS2.1', 'box.html#propdef-border-left-color', 'border-left-color') }} {{ Spec2('CSS2.1') }} Initial definition.

Browser compatibility

{{ CompatibilityTable() }}

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 1.0 {{ CompatGeckoDesktop("1.0") }} [1] 4 3.5 1.0 (85)
Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support 1.0 {{ CompatGeckoMobile("1.0") }} [1] {{ CompatVersionUnknown() }} {{ CompatVersionUnknown() }} {{ CompatVersionUnknown() }}

[1] Gecko-based browsers like Firefox also supports the non-standard {{ Cssxref("-moz-border-left-colors") }} CSS properties that sets the left border to multiple colors.

See also

  • The border-related CSS shorthand properties {{ Cssxref("border") }}, {{ Cssxref("border-left") }}, and {{ Cssxref("border-color") }}.
  • The color-related CSS properties applying to the other borders: {{ Cssxref("border-right-color") }}, {{ Cssxref("border-bottom-color") }}, and {{ Cssxref("border-top-color") }}.
  • The other border-related CSS properties applying to the same border: {{ cssxref("border-left-style") }} and {{ cssxref("border-left-width") }}.

{{ languages( { "de": "de/CSS/border-left-color", "fr": "fr/CSS/border-left-color", "ja": "ja/CSS/border-left-color", "pl": "pl/CSS/border-left-color", "pt":"pt/CSS/border-left-color" } ) }}

Revision Source

<p>{{ CSSRef() }}</p>
<h2 id="Summary">Summary</h2>
<p>The <code>border-left-color</code> CSS property sets the color of the bottom border of an element. Note that in many cases the shorthand CSS properties&nbsp;{{ cssxref("border-color") }} or {{ cssxref("border-left") }} are more convenient and preferable.</p>
<ul class="cssprop">
  <li><dfn>{{ Xref_cssinitial() }}</dfn> {{ cssinitial("border-left-color") }}, the element's {{ Cssxref("color") }} property's value</li>
  <li><dfn>Applies to</dfn> all elements</li>
  <li><dfn>{{ Xref_cssinherited() }}</dfn> no</li>
  <li><dfn>Media</dfn> {{ Xref_cssvisual() }}</li>
  <li><dfn>{{ Xref_csscomputed() }}</dfn> the computed color</li>
</ul>
<h2 id="Syntax">Syntax</h2>
<pre class="twopartsyntaxbox">
<a href="/en-US/docs/CSS/Value_definition_syntax" title="/en-US/docs/CSS/Value_definition_syntax">Formal syntax</a>: {{csssyntax("border-left-color")}}
</pre>
<pre>
border-left-color: <em>color</em>

border-left-color: inherit
</pre>
<h3>Values</h3>
<dl>
  <dt>
    <em>color</em></dt>
  <dd>
    Is a {{ Xref_csscolorvalue() }} CSS value describing the color of the left border.</dd>
  <dt>
    <code>inherit</code></dt>
  <dd>
    Is a keyword denoting the color of the bottom border of the parent's element (which may be different from the <code>border-left-color</code> default value)</dd>
</dl>
<h2 id="Examples">Examples</h2>
<pre style="border-style: solid; border-color: gold gold gold red; border-width: 0.3em;">
pre {
    border: solid 0.3em gold;
    border-left-color: red;
}
/* this has the same result:
pre {
        border: solid 0.3em;
        border-color: gold gold gold red; 
} */
</pre>
<h2 id="Specifications">Specifications</h2>
<table class="standard-table">
  <thead>
    <tr style="background-color: rgb(255, 204, 255);">
      <th scope="col">Specification</th>
      <th scope="col">Status</th>
      <th scope="col">Comment</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>{{ SpecName('CSS3 Backgrounds', '#border-left-color', 'border-left-color') }}</td>
      <td>{{ Spec2('CSS3 Backgrounds') }}</td>
      <td>No significant changes, though the <code>transparent</code> keyword, now included in {{ xref_csscolorvalue() }} which has been extended, has been formally removed.</td>
    </tr>
    <tr>
      <td>{{ SpecName('CSS2.1', 'box.html#propdef-border-left-color', 'border-left-color') }}</td>
      <td>{{ Spec2('CSS2.1') }}</td>
      <td>Initial definition.</td>
    </tr>
  </tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Chrome</th>
        <th>Firefox (Gecko)</th>
        <th>Internet Explorer</th>
        <th>Opera</th>
        <th>Safari (WebKit)</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>1.0</td>
        <td>{{ CompatGeckoDesktop("1.0") }} [1]</td>
        <td>4</td>
        <td>3.5</td>
        <td>1.0 (85)</td>
      </tr>
    </tbody>
  </table>
</div>
<div id="compat-mobile">
  <table class="compat-table">
    <tbody>
      <tr>
        <th>Feature</th>
        <th>Android</th>
        <th>Firefox Mobile (Gecko)</th>
        <th>IE Phone</th>
        <th>Opera Mobile</th>
        <th>Safari Mobile</th>
      </tr>
      <tr>
        <td>Basic support</td>
        <td>1.0</td>
        <td>{{ CompatGeckoMobile("1.0") }} [1]</td>
        <td>{{ CompatVersionUnknown() }}</td>
        <td>{{ CompatVersionUnknown() }}</td>
        <td>{{ CompatVersionUnknown() }}</td>
      </tr>
    </tbody>
  </table>
</div>
<p>[1] Gecko-based browsers like Firefox also supports the non-standard {{ Cssxref("-moz-border-left-colors") }} CSS properties that sets the left border to <strong>multiple</strong> colors.</p>
<h3 id="See_also">See also</h3>
<ul>
  <li>The border-related CSS shorthand properties {{ Cssxref("border") }}, {{ Cssxref("border-left") }}, and {{ Cssxref("border-color") }}.</li>
  <li>The color-related CSS properties applying to the other borders: {{ Cssxref("border-right-color") }}, {{ Cssxref("border-bottom-color") }}, and {{ Cssxref("border-top-color") }}.</li>
  <li>The other border-related CSS properties applying to the same border: {{ cssxref("border-left-style") }} and {{ cssxref("border-left-width") }}.</li>
</ul>
<p>{{ languages( { "de": "de/CSS/border-left-color", "fr": "fr/CSS/border-left-color", "ja": "ja/CSS/border-left-color", "pl": "pl/CSS/border-left-color", "pt":"pt/CSS/border-left-color" } ) }}</p>
Revert to this revision