mozilla

Revision 570959 of border-bottom-color

  • Revision slug: Web/CSS/border-bottom-color
  • Revision title: border-bottom-color
  • Revision id: 570959
  • Created:
  • Creator: J-Mackerel
  • Is current revision? No
  • Comment Update compat table. convert demo to live sample format.

Revision Content

{{ CSSRef("CSS Borders") }}

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.

{{cssbox("border-bottom-color")}}

Syntax

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

Values

<color>
Is a {{ Xref_csscolorvalue() }} CSS value describing the color of the bottom 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

A simple div with a border

HTML Content

<div class="mybox">
    <p>This is a box with a border around it.
       Note which side of the box is
       <span class="redtext">red</span>.</p>
</div>

CSS Content

.mybox {
    border: solid 0.3em gold;
    border-bottom-color: red;
    width: auto;
}
.redtext {
    color: red;
}

{{ EmbedLiveSample('A_simple_div_with_a_border') }}

Specifications

Specification Status Comment
{{ SpecName('CSS3 Backgrounds', '#border-bottom-color', 'border-bottom-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#border-color-properties', 'border-bottom-color') }} {{ Spec2('CSS2.1') }}  

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] 6.5 11 1.0

[1] Gecko-based browsers like Firefox also supports the non-standard {{ Cssxref("-moz-border-bottom-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-top-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") }}.

Revision Source

<p>{{ CSSRef("CSS Borders") }}</p>
<h2 id="Summary">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>
<p>{{cssbox("border-bottom-color")}}</p>
<h2 id="Syntax">Syntax</h2>
<pre class="syntaxbox">
<a href="/en-US/docs/CSS/Value_definition_syntax" title="/en-US/docs/CSS/Value_definition_syntax">Formal syntax</a>: {{csssyntax("border-bottom-color")}}
</pre>
<h3 id="Values">Values</h3>
<dl>
 <dt>
  <code>&lt;color&gt;</code></dt>
 <dd>
  Is a {{ Xref_csscolorvalue() }} CSS value describing the color of the bottom 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-bottom-color</code> default value)</dd>
</dl>
<h2 id="Examples">Examples</h2>
<h3 name="A_simple_div_with_a_border">A simple div with a border</h3>
<h4>HTML Content</h4>
<pre class="brush: html">
&lt;div class="mybox"&gt;
&nbsp;   &lt;p&gt;This is a box with a border around it.
&nbsp;      Note which side of the box is
&nbsp;      &lt;span class="redtext"&gt;red&lt;/span&gt;.&lt;/p&gt;
&lt;/div&gt;</pre>
<h4>CSS Content</h4>
<pre class="brush: css">
.mybox {
    border: solid 0.3em gold;
    border-bottom-color: red;
    width: auto;
}
.redtext {
    color: red;
}</pre>
<p>{{ EmbedLiveSample('A_simple_div_with_a_border') }}</p>
<h2 id="Specifications">Specifications</h2>
<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Status</th>
   <th scope="col">Comment</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{ SpecName('CSS3 Backgrounds', '#border-bottom-color', 'border-bottom-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#border-color-properties', 'border-bottom-color') }}</td>
   <td>{{ Spec2('CSS2.1') }}</td>
   <td>&nbsp;</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>6.5</td>
    <td>11</td>
    <td>1.0</td>
   </tr>
  </tbody>
 </table>
</div>
<p>[1] Gecko-based browsers like Firefox also supports the non-standard {{ Cssxref("-moz-border-bottom-colors") }} CSS properties that sets the top 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-bottom") }}, and {{ Cssxref("border-color") }}.</li>
 <li>The color-related CSS properties applying to the other borders: {{ Cssxref("border-right-color") }}, {{ Cssxref("border-top-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>
Revert to this revision