Want to share your CSS expertise with others? Apply to the MDN Fellowship by April 1! http://mzl.la/MDNFellowship

mozilla

Revision 21084 of border-bottom

  • Revision slug: CSS/border-bottom
  • Revision title: border-bottom
  • Revision id: 21084
  • Created:
  • Creator: DBaron
  • Is current revision? No
  • Comment /* Values */

Revision Content

{{template.CSSRef()}}

Summary

The border-bottom property is a shorthand property that sets the values of {{template.Cssxref("border-bottom-color")}}, {{template.Cssxref("border-bottom-style")}}, and {{template.Cssxref("border-bottom-width")}}. These properties describe the bottom border of elements.

  • Initial value: see individual properties for details
  • Applies to: all elements
  • Inherited: no
  • Percentages: N/A
  • Media: visual
  • Computed value: see individual properties

Syntax

border-bottom: {{mediawiki.external(' <border-width> || <border-style> || <border-color> ')}} | inherit

Values

<border-width> 
See {{template.Cssxref("border-bottom-width")}}.
<border-style> 
See {{template.Cssxref("border-bottom-style")}}.
<border-color> 
See {{template.Cssxref("border-bottom-color")}}.

Examples

{{template.CSSRefExampleLink("border")}}

element { 
    border-bottom-width: 1px solid #000;
}

Notes

The three values of the shorthand property can be specified in any order, and one or two of them may be omitted.

As with all shorthand properties, border-bottom always sets the values of all of the properties that it can set, even if they are not specified. It sets those that are not specified to their default values. This means that:

  border-bottom-style: dotted;
  border-bottom: thick green;

is actually the same as

  border-bottom-style: dotted;
  border-bottom: none thick green;

and the value of {{template.Cssxref("border-bottom-style")}} given before border-bottom is ignored.

Since the default value of {{template.Cssxref("border-bottom-style")}} is none, not specifying the <border-style> part of the value means that the property specifies no border.

Specifications

Browser compatibility

Browser Lowest Version
Internet Explorer 4
Firefox 1
Netscape 4
Opera 3.5

See also

{{template.Cssxref("border")}}, {{template.Cssxref("border-bottom")}}, {{template.Cssxref("border-bottom-width")}}, {{template.Cssxref("border-bottom-style")}}, {{template.Cssxref("border-bottom-color")}},

Revision Source

<p> 
{{template.CSSRef()}}
</p>
<h3 name="Summary"> Summary </h3>
<p>The <code>border-bottom</code> property is a shorthand property that sets the values of {{template.Cssxref("border-bottom-color")}}, {{template.Cssxref("border-bottom-style")}}, and {{template.Cssxref("border-bottom-width")}}.  These properties describe the bottom border of elements.
</p>
<ul><li> Initial value: see individual properties for details
</li><li> Applies to: all elements
</li><li> Inherited: no
</li><li> Percentages: N/A
</li><li> Media: <a href="en/CSS/Media/Visual">visual</a>
</li><li> Computed value: see individual properties
</li></ul>
<h3 name="Syntax"> Syntax </h3>
<p>border-bottom: {{mediawiki.external(' &lt;border-width&gt; || &lt;border-style&gt; || &lt;border-color&gt; ')}} | <i>inherit</i>
</p>
<h3 name="Values"> Values </h3>
<dl><dt> &lt;border-width&gt; </dt><dd> See {{template.Cssxref("border-bottom-width")}}.
</dd><dt> &lt;border-style&gt; </dt><dd> See {{template.Cssxref("border-bottom-style")}}.
</dd><dt> &lt;border-color&gt; </dt><dd> See {{template.Cssxref("border-bottom-color")}}.
</dd></dl>
<h3 name="Examples"> Examples </h3>
<p>{{template.CSSRefExampleLink("border")}}
</p>
<pre>element { 
    border-bottom-width: 1px solid #000;
}
</pre>
<h3 name="Notes"> Notes </h3>
<p>The three values of the shorthand property can be specified in any order, and one or two of them may be omitted.
</p><p>As with all shorthand properties, <code>border-bottom</code> always sets the values of all of the properties that it can set, even if they are not specified.  It sets those that are not specified to their default values.  This means that:
</p>
<pre>  border-bottom-style: dotted;
  border-bottom: thick green;</pre>
<p>is actually the same as
</p>
<pre>  border-bottom-style: dotted;
  border-bottom: none thick green;</pre>
<p>and the value of {{template.Cssxref("border-bottom-style")}} given before <code>border-bottom</code> is ignored.
</p><p>Since the default value of {{template.Cssxref("border-bottom-style")}} is <code>none</code>, not specifying the &lt;border-style&gt; part of the value means that the property specifies no border.
</p>
<h3 name="Specifications"> Specifications </h3>
<ul><li> <a class="external" href="http://www.w3.org/TR/CSS1#border-bottom">CSS 1</a>
</li><li> <a class="external" href="http://www.w3.org/TR/CSS21/box.html#border-shorthand-properties">CSS 2.1</a>
</li><li> <a class="external" href="http://www.w3.org/TR/css3-background/#the-border-shorthands">CSS 3</a>
</li></ul>
<h3 name="Browser_compatibility"> Browser compatibility </h3>
<table class="standard-table">
  <tbody><tr>
    <th>Browser</th>
    <th>Lowest Version</th>
  </tr>
  <tr>
    <td>Internet Explorer</td>
    <td>4</td>
  </tr>
  <tr>
    <td>Firefox</td>
    <td>1</td>
  </tr>
  <tr>
    <td>Netscape</td>
    <td>4</td>
  </tr>
  <tr>
    <td>Opera</td>
    <td>3.5</td>
  </tr>
</tbody></table>
<h3 name="See_also"> See also </h3>
<p>{{template.Cssxref("border")}},
{{template.Cssxref("border-bottom")}}, 
{{template.Cssxref("border-bottom-width")}}, 
{{template.Cssxref("border-bottom-style")}}, 
{{template.Cssxref("border-bottom-color")}},
</p>
Revert to this revision