Export (0) Print
Expand All

clear

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 }

sClear

String that specifies or receives one of the following values:

none

Default. Floating objects are allowed on both sides.

both

Object is moved below any floating object.

left

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

right

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:

<style>
    i { clear: left; }
</style>

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

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

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

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

Community Additions

ADD
Show:
© 2014 Microsoft