CSSオーバーフロー-xプロパティ
例
さまざまなoverflow-xプロパティ値を表示します。
div.ex1 {
overflow-x: scroll;
}
div.ex2 {
overflow-x: hidden;
}
div.ex3 {
overflow-x:
auto;
}
div.ex4 {
overflow-x: visible;
}
定義と使用法
このoverflow-x
プロパティは、ブロックレベルの要素が左端と右端でオーバーフローしたときに、コンテンツをクリップするか、スクロールバーを追加するか、オーバーフローコンテンツを表示するかを指定します。
ヒント:overflow-yプロパティを使用して、上端と下端のクリッピングを決定します。
デフォルト値: | 見える |
---|---|
遺伝性の: | いいえ |
アニメート可能: | 番号。アニメート可能について読む |
バージョン: | CSS3 |
JavaScript構文: | object .style.overflowX = "scroll" |
ブラウザのサポート
表の数字は、プロパティを完全にサポートする最初のブラウザバージョンを示しています。
数字の後に-ms-が続く場合は、プレフィックスを使用して機能した最初のバージョンを指定します。
Property | |||||
---|---|---|---|---|---|
overflow-x | 4.0 | 9.0 8.0 -ms- |
3.5 | 3.0 | 9.5 |
CSS構文
overflow-x: visible|hidden|scroll|auto|initial|inherit;
プロパティ値
Value | Description | Play it |
---|---|---|
visible | The content is not clipped, and it may be rendered outside the left and right edges. 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リファレンス:overflowXプロパティ