Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Style clear Property

Style clear Property

Style Object Reference The Style object


Definition and Usage

The clear property sets or returns the position of an element relative to floating objects.

Syntax

Set the clear property:

Object.style.clear="none|left|right|both|inherit"

Return the clear property:

Object.style.clear

Value Description
none Default. Allows floating objects to appear on both sides of the element.
left Does not allow floating objects to appear on the left side of the element.
right Does not allow floating objects to appear on the right side of the element.
both Does not allow floating objects to appear on the left or right side of the element.
inherit The value of the clear property should be inherited from the parent element.

Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the clear property.

**Note:** IE7 and earlier versions do not support the "inherit" value. IE8 supports "inherit" only if a !DOCTYPE is specified. IE9 supports "inherit".


Example

Example

Do not allow floating objects to appear on the left side of the text:

Runoob Tutorial(runoob.com)

    

This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.

Try it »


Style Object Reference The Style object