Sets whether the object allows floating objects on its left side, right side, or both, so that the text that follows is displayed below the floating objects.


{ clear: sClear }

Possible values


String that specifies one of the following values:


Default. Floating objects are allowed on both sides.


Object is moved below any floating object.


Object is moved below any floating object on the left side.


Object is moved below any floating object on the right side.

This property has a default value of none. It is not inherited.


The value of this property lists the sides where floating objects are not accepted.


The following example uses the clear property to specify placement of text relative to floating objects. This example uses a call to an embedded (global) style sheet to move the text below the floating objects when italic text is encountered:

    i { clear: left; }

This example changes the position of the paragraph relative to the floating object on its left side:

function fnClear(){"left";
function fnClear2(){"none";
<img src="/workshop/graphics/sphere.jpg" style="float:left">
    <span id="oClear">
        <p>This is an example of the clear property.<p>

        <input type=button value ="clear = left" onclick="fnClear()"> 
        <input type=button value ="clear = none" onclick="fnClear2()">

Standards information

Applies to

a, address, applet, b, big, blockquote, button, caption, center, cite, code, col, colgroup, custom, dd, defaults, dfn, div, dl, dt, em, embed, fieldset, form, hn, hr, i, iframe, img, input type=button, input type=checkbox, input type=file, input type=image, input type=password, input type=radio, input type=reset, input type=submit, input type=text, li, object, ol, option, p, s, select, span, sub, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, var, xmp

See also



Send feedback about this topic to Microsoft. © 2011 Microsoft Corporation. All rights reserved.

Community Additions