CSSオーバーフロー-yプロパティ
例
さまざまなoverflow-yプロパティ値を表示します。
div.ex1 {
overflow-y: scroll;
}
div.ex2 {
overflow-y: hidden;
}
div.ex3 {
overflow-y:
auto;
}
div.ex4 {
overflow-y: visible;
}
定義と使用法
このoverflow-y
プロパティは、ブロックレベルの要素が上端と下端でオーバーフローしたときに、コンテンツをクリップするか、スクロールバーを追加するか、オーバーフローコンテンツを表示するかを指定します。
ヒント:overflow-xプロパティを使用して、左端と右端のクリッピングを決定します。
デフォルト値: | 見える |
---|---|
遺伝性の: | いいえ |
アニメート可能: | 番号。アニメート可能について読む |
バージョン: | CSS3 |
JavaScript構文: | object .style.overflowY = "scroll" |
ブラウザのサポート
表の数字は、プロパティを完全にサポートする最初のブラウザバージョンを示しています。
数字の後に-ms-が続く場合は、プレフィックスで機能した最初のバージョンを指定します。
Property | |||||
---|---|---|---|---|---|
overflow-y | 4.0 | 9.0 8.0 -ms- |
1.5 | 3.0 | 9.5 |
CSS構文
overflow-y: visible|hidden|scroll|auto|initial|inherit;
プロパティ値
Value | Description | Play it |
---|---|---|
visible | The content is not clipped, and it may be rendered outside the content box. This is default | |
hidden | The content is clipped - and no scrolling mechanism is provided | |
scroll | The content is clipped and a scrolling mechanism is provided | |
auto | Should cause a scrolling mechanism to be provided for overflowing boxes | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
関連ページ
CSSチュートリアル:CSSオーバーフロー
HTML DOMリファレンス:overflowYプロパティ