絶対配置の <div> 要素の下端を、最も近くに配置された祖先の下端の上 70px に設定します:
div.absolute {
position: absolute;
bottom: 70px;
width: 200px;
height: 100px;
border: 3px solid #8AC007;
}
Try it Yourself ❯
絶対配置の要素に対する bottom プロパティは、最も近くに配置された祖先の下端から上/下へ離す量を設定します。
注: 絶対配置の要素に "positioned" 配置の親がない場合は、文書の body が使われ、ページスクロールすると一緒に移動します。
注: "positioned" 要素とは、static 配置以外のものです。
相対配置の要素に対する bottom プロパティは、要素の下端を通常位置から上/下へ離す量を設定します。
注: "position:static" の場合、bottom プロパティの効果がありません。
デフォルト値: | auto |
---|---|
継承: | 継承する |
アニメーション可否: | 可。animatable を参照 Try it |
バージョン: | CSS2 |
JavaScript 構文: | object.style.bottom="10px" Try it |
表中の数字は、完全にプロパティをサポートした最初のブラウザのバージョンです。
プロパティ | |||||
---|---|---|---|---|---|
bottom | 1.0 | 5.0 | 1.0 | 1.0 | 6.0 |
bottom: auto|length|initial|inherit;
値 | 説明 | Play it |
---|---|---|
auto | 下端の位置をブラウザが計算します。これがデフォルトです | Play it ❯ |
length | px、cm 等で下端の位置を設定します。マイナスの数値が使用できます | Play it ❯ |
% | 包含要素の % で下端の位置を設定します。マイナスの数値が使用できます | Play it ❯ |
initial | プロパティにデフォルト値を設定します。initial を参照 | Play it ❯ |
inherit | このプロパティは親要素を継承します。inherit を参照 |
CSS チュートリアル: CSS Positioning
CSSリファレンス:top プロパティ
CSSリファレンス:left プロパティ
CSSリファレンス:right プロパティ
HTML DOM リファレンス:bottom プロパティ