CSS margin-bottom プロパティ

❮ 前章へ 完全な CSS リファレンス 次へ ❯

<p> 要素の下マージンを設定します:

p {
    margin-bottom: 2cm;
}
Try it Yourself ❯

定義と用法

margin-bottom プロパティは、要素の下マージンを設定します。

注: 負の値が使用できます.

デフォルト値: 0
継承: 継承する
アニメーション可否: yes, 個別のプロパティを参照してください. animatable を参照 Try it
バージョン: CSS1
JavaScript 構文: object.style.marginBottom="100px" Try it

ブラウザ・サポート

表中の数字は、完全にプロパティをサポートした最初のブラウザのバージョンです。

プロパティ
margin-bottom 1.0 6.0 1.0 1.0 3.5

CSS 構文

margin-bottom: length|auto|initial|inherit;

プロパティの値

説明 Play it
length px、pt、cm 等で下マージンを指定します。 デフォルトは 0px です Play it ❯
% 包含要素の幅の割合で下マージンを指定します Play it ❯
auto ブラウザが下マージンを計算します Play it ❯
initial プロパティにデフォルト値を設定します。initial を参照 Play it ❯
inherit このプロパティは親要素を継承します。inherit を参照

関連ページ

CSS チュートリアル: CSS Margin

HTML DOM リファレンス:marginBottom プロパティ


❮ 前章へ 完全な CSS リファレンス 次へ ❯