asp.net.ph

Skip Navigation Links

clear Attribute | clear Property

CSS Attributes Index   Box Attributes


Sets or retrieves whether the object allows floating objects on its left and/or right sides so that the next text will display past the floating objects.

Syntax


CSS { clear: 'none' | 'left' | 'right' | 'both' }
Script object.style.clear = sClear ]

Possible Values


none Floating objects are allowed on both sides.
left Object is moved below any floating object on the left side.
right Object is moved below any floating object on the right side.
both Object is moved below any floating object.

The property is read/write with a default value of none; the CSS attribute is not inherited.

Remarks

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

Example

The following examples demonstrate use of inline event handlers to dynamically set the placement of text relative to floating elements. Both methods yield the same effect.

The sample below uses calls to an embedded stylesheet to move the text below the floating objects when italic text is encountered.

<style>
  I { clear:"left"}
</style>

This feature requires Microsoft® Internet Explorer® 4.0 or later.

 Show me 

The sample below uses inline event handlers to affect the text.

<img src="sample.jpg"
  style="float:left"
  onclick="this.style.clear='left'">

This feature requires Microsoft® Internet Explorer® 4.0 or later.

 Show me 

See Also

float



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note