Name
clear — NN 4 IE 4 CSS 1
Synopsis
Inherited: No
Defines whether the element allows itself to be displayed in the same
horizontal band as a floating element, such as an image. Typically,
another element in the vicinity has its float
style attribute set to left or
right. To prevent the current element from being
in the same band as the floating block, set the
clear attribute to the same side
(left or right). If you
aren’t sure where the potential overlap might occur, set the
clear attribute to both. An
element whose clear attribute is set to a value
other than none is rendered at the beginning of
the next available line below the floating element.
CSS Syntax
clear: both | left | none | right
JavaScript Equivalent
clear
Value
Any of the following constants: both |
left | none |
right
Initial Value
None.
Example
<IMG SRC="logo.gif" HEIGHT=40 WIDTH=60 STYLE="float: right"> <H1 STYLE="clear: right">Giantco Corporation</H1>
Applies To
All elements.
Object Model Reference
- IE
[window.]document.all.elementID.style.clear
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access