mozilla

Revision 25845 of margin-bottom

  • Revision slug: CSS/margin-bottom
  • Revision title: margin-bottom
  • Revision id: 25845
  • Created:
  • Creator: Yuichiro
  • Is current revision? No
  • Comment 1 words added, 1 words removed

Revision Content

{{ CSSRef() }}

Summary

The margin-bottom property of an element sets the margin space required on the bottom of an element. A negative value is also allowed.

  • {{ Xref_cssinitial() }}: 0
  • Applies to: all elements except those with table display types other than table-caption, table, and inline-table
  • {{ Xref_cssinherited() }}: no
  • Percentages: refer to {{ Cssxref("width") }} of closest block-level ancestor
  • Media: {{ Xref_cssvisual() }}
  • {{ Xref_csscomputed() }}: the percentage as specified or the absolute length

Syntax

margin-bottom: {{ Xref_csslength() }} | {{ Xref_csspercentage() }} | {{ Cssxref("inherit") }} | {{ Cssxref("auto") }};

Values

<length>
Specifies a fixed width. See {{ xref_csslength() }} for possible values.
<percentage>
 A {{ xref_csspercentage() }} always relative to the width of the containing block.
auto
See {{ cssxref("margin") }}.

Examples

.content { margin-bottom: 5%; }
.sidebox { margin-bottom: 10px; }
.logo    { margin-bottom: -5px; }
#header  { margin-bottom: 1em; }

Specifications

Browser compatibility

Browser Lowest Version auto Value
Internet Explorer 3.0 6.0 in strict Mode
Firefox (Gecko) 1.0 (1.0) 1.0 (1.0)
Opera 3.5 3.5
Safari (WebKit) 1.0 (85) 1.0 (85)

See also

{{ CSS_Reference:Margin() }}

{{ languages( { "de": "de/CSS/margin-bottom", "ja": "ja/CSS/margin-bottom" } ) }}

Revision Source

<p>{{ CSSRef() }}</p>
<h3 name="Summary">Summary</h3>
<p>The <code>margin-bottom</code> property of an element sets the margin space required on the bottom of an element. A negative value is also allowed.</p>
<ul> <li>{{ Xref_cssinitial() }}: 0</li> <li>Applies to: all elements except those with table display types other than <code>table-caption</code>, <code>table</code>, and <code>inline-table</code></li> <li>{{ Xref_cssinherited() }}: no</li> <li>Percentages: refer to {{ Cssxref("width") }} of closest block-level ancestor</li> <li>Media: {{ Xref_cssvisual() }}</li> <li>{{ Xref_csscomputed() }}: the percentage as specified or the absolute length</li>
</ul><h3 name="Syntax">Syntax</h3>
<pre class="eval">margin-bottom: {{ Xref_csslength() }} | {{ Xref_csspercentage() }} | {{ Cssxref("inherit") }} | {{ Cssxref("auto") }};
</pre>
<h3 name="Values">Values</h3>
<dl> <dt>&lt;length&gt;</dt> <dd>Specifies a fixed width. See {{ xref_csslength() }} for possible values.</dd> <dt>&lt;percentage&gt;</dt> <dd> A {{ xref_csspercentage() }} always relative to the <strong>width</strong> of the containing block.</dd> <dt>auto</dt> <dd>See {{ cssxref("margin") }}.</dd>
</dl>
<h3 name="Examples">Examples</h3>
<pre>.content { margin-bottom: 5%; }
.sidebox { margin-bottom: 10px; }
.logo    { margin-bottom: -5px; }
#header  { margin-bottom: 1em; }
</pre>
<h3 name="Specifications">Specifications</h3>
<ul> <li><a class="external" href="http://www.w3.org/TR/CSS1#margin-bottom">CSS 1</a></li> <li><a class="external" href="http://www.w3.org/TR/CSS21/box.html#margin-properties">CSS 2.1 box</a></li> <li><a class="external" href="http://www.w3.org/TR/css3-box/#the-margin">CSS 3 box</a></li>
</ul>
<h3>Browser compatibility</h3>
<table class="standard-table"> <tbody> <tr> <th>Browser</th> <th>Lowest Version</th> <th><code>auto </code>Value</th> </tr> <tr> <td>Internet Explorer</td> <td>3.0</td> <td>6.0 in strict Mode</td> </tr> <tr> <td>Firefox (Gecko)</td> <td>1.0 (1.0)</td> <td>1.0 (1.0)</td> </tr> <tr> <td>Opera</td> <td>3.5</td> <td>3.5</td> </tr> <tr> <td>Safari (WebKit)</td> <td>1.0 (85)</td> <td>1.0 (85)</td> </tr> </tbody>
</table>
<h3>See also</h3>
<p>{{ CSS_Reference:Margin() }}</p>
<p>{{ languages( { "de": "de/CSS/margin-bottom", "ja": "ja/CSS/margin-bottom" } ) }}</p>
Revert to this revision