Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

概要

margin-top プロパティは、要素の上に必要な余白を設定します。負の値も指定可能です。

初期値0
適用対象テーブル系要素を除く全ての要素。ただし、table-captiontableinline-table には適用できます。. It also applies to ::first-letter.
継承不可
相対値の基準包含ブロックの幅
メディアvisual
計算値指定されたパーセンテージ値または絶対的な長さ
アニメーションの可否可。 の値として補完しますlength
正規順序形式文法で定義される一意のあいまいでない順序

構文

<length> | <percentage> | auto

<length>
固定幅を指定します。使用可能な値は <length> を参照してください。
<percentage>
<percentage>は常に包含ブロックのを基準にします。
auto
margin を参照してください。

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

仕様

仕様書 策定状況 コメント
CSS Basic Box Model
margin-top の定義
草案 有意な変更点は無し
CSS Transitions
margin-top の定義
草案 margin-top がアニメーション可能プロパティとして定義された
CSS Level 2 (Revision 1)
margin-top の定義
勧告 インライン要素への効果が削除された
CSS Level 1
margin-top の定義
勧告 最初期の仕様

ブラウザ実装状況

機能 Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
基本サポート 1.0 1.0 (1.7 or earlier) 3.0 3.5 1.0 (85)
auto 1.0 1.0 (1.7 or earlier) 6.0 (strict mode) 3.5 1.0 (85)
機能 Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
基本サポート 1.0 1.0 (1) 6.0 6.0 1.0

ドキュメントのタグと貢献者

タグ: 
 このページの貢献者: Sebastianz, Simplexible, Prinz_Rana, fscholz, ethertank, Yuichiro
 最終更新者: Sebastianz,