スタイルクリアプロパティ
例
要素内のテキストの左側にあるフローティングオブジェクトを禁止します。
document.getElementById("demo").style.clear = "left";
定義と使用法
clearプロパティは、フローティングオブジェクトに対する要素の位置を設定または返します。
ブラウザのサポート
Property | |||||
---|---|---|---|---|---|
clear | Yes | Yes | Yes | Yes | Yes |
構文
clearプロパティを返します。
object.style.clear
clearプロパティを設定します。
object.style.clear = "none|left|right|both|initial|inherit"
プロパティ値
Value | Description |
---|---|
none | Allows floating objects on both sides of the element. This is default |
left | No floating objects allowed on the left side of the element |
right | No floating objects allowed on the right side of the element |
both | No floating objects allowed on either the left or right side of the element |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
技術的な詳細
デフォルト値: | なし |
---|---|
戻り値: | フローティングオブジェクトに対する要素の位置を表す文字列 |
CSSバージョン | CSS1 |
その他の例
例
clearプロパティを返します。
alert(document.getElementById("demo").style.clear);
関連ページ
CSSチュートリアル:CSS Float
CSSリファレンス:clearプロパティ
❮スタイルオブジェクト