border-bottom-color

  • Revision slug: CSS/border-bottom-color
  • Revision title: border-bottom-color
  • Revision id: 21060
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment 490 words added, 23 words removed

Revision Content

{{ CSSRef() }}

Summary

The border-bottom-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-bottom") }} are more convenient and preferable.

  • {{ Xref_cssinitial() }}: {{ cssxref("currentColor") }}, the element's {{ Cssxref("color") }} property's value
  • Applies to: all elements
  • {{ Xref_cssinherited() }}: no
  • Percentages: N/A
  • Media: {{ Xref_cssvisual() }}
  • {{ Xref_csscomputed() }}: the computed color

Syntax

border-top-color: color     or
border-top-color: inherit

where:

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

Examples

{{ CSSRefExampleLink("border") }}

pre {
    border: ridge 1em gold;
    border-top-color: red;
}
/* this has the same result:
pre {
        border: ridge 1em;
        border-color: red gold gold; 
} */

Specifications

Specification Status Comment
CSS Backgrounds and Borders Module Level 3 {{ Spec2('CSS3 Backgrounds') }} No significant changes, though the transparent keyword, now included in {{ xref_csscolorvalue() }} which has been extended, has been formally removed.
CSS 2.1 {{ Spec2('CSS2.1') }} Added the support of the transparent keyword
CSS 1 {{ Spec2('CSS1') }}  

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-top-colors") }} CSS properties that sets the top border to multiple colors.

See also

  • The border-related CSS shorthand properties {{ Cssxref("border") }}, {{ Cssxref("border-bottom") }}, 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-left-color") }}.
  • The other border-related CSS properties applying to the same border: {{ cssxref("border-bottom-style") }} and {{ cssxref("border-bottom-width") }}.

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

Revision Source

<p>{{ CSSRef() }}</p>
<h2>Summary</h2>
<p>The<code> border-bottom-color </code>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-bottom") }} are more convenient and preferable.</p>
<ul> <li>{{ Xref_cssinitial() }}: {{ cssxref("currentColor") }}, the element's {{ Cssxref("color") }} property's value</li> <li>Applies to: all elements</li> <li>{{ Xref_cssinherited() }}: no</li> <li>Percentages: N/A</li> <li>Media: {{ Xref_cssvisual() }}</li> <li>{{ Xref_csscomputed() }}: the computed color</li>
</ul>
<h2>Syntax</h2>
<pre>border-top-color: <em>color     or
</em>border-top-color: inherit
</pre>
<p>where:</p>
<dl> <dt><em>color</em></dt> <dd>Is a {{ Xref_csscolorvalue() }} CSS value describing the color of the top border.</dd> <dt>inherit</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-bottom-color</code> default value)</dd>
</dl>
<h2>Examples</h2>
<p>{{ CSSRefExampleLink("border") }}</p>
<pre style="border-style: ridge; border-color: red gold gold; border-width: 1em;">pre {
    border: ridge 1em gold;
    border-top-color: red;
}
/* this has the same result:
pre {
        border: ridge 1em;
        border-color: red gold gold; 
} */
</pre>
<h2>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><a class="external" href="http://www.w3.org/TR/css3-background/#background-bottom" title="http://www.w3.org/TR/css3-background/#background-bottom">CSS Backgrounds and Borders Module Level 3</a></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><a class="external" href="http://www.w3.org/TR/CSS21/box.html#propdef-border-bottom" title="http://www.w3.org/TR/CSS21/box.html#propdef-border-bottom">CSS 2.1</a></td> <td>{{ Spec2('CSS2.1') }}</td> <td>Added the support of the <code>transparent</code> keyword</td> </tr> <tr> <td><a class="external" href="http://www.w3.org/TR/CSS1/#border-bottom" title="http://www.w3.org/TR/CSS1/#border-bottom">CSS 1</a></td> <td>{{ Spec2('CSS1') }}</td> <td> </td> </tr> </tbody>
</table>
<h2>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-top-colors") }} CSS properties that sets the top border to <strong>multiple</strong> colors.</p>
<h3>See also</h3>
<ul> <li>The border-related CSS shorthand properties {{ Cssxref("border") }}, {{ Cssxref("border-bottom") }}, 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-left-color") }}.</li> <li>The other border-related CSS properties applying to the same border: {{ cssxref("border-bottom-style") }} and {{ cssxref("border-bottom-width") }}.</li>
</ul>
<p>{{ languages( { "de": "de/CSS/border-top-color", "fr": "fr/CSS/border-top-color", "ja": "ja/CSS/border-top-color", "pl": "pl/CSS/border-top-color" } ) }}</p>
Revert to this revision