This property specifies whether the current element allows floated
elements occuring earlier in the document to float along its sides.
The values for this property indicate which sides of the element do
not allow floating elements. If the current element has any floating
sub-elements, the property does not apply to them.
Allowed Values
inherit
[CSS2|CSS2.1]
[N6|O4|S1]
Type: Explicit
Description:
Explicitly sets the value of this property to that of the parent.
none
[CSS1|CSS2|CSS2.1]
[IE4B2|N4B2|O3.5|S1]
Type: Explicit
Description:
No restriction is made on floating element placement behavior.
left
[CSS1|CSS2|CSS2.1]
[IE4B2|N4B2|O3.5|S1]
Type: Explicit
Description:
The current element is shifted such that the top edge of the top
margin is below the bottom edge of any left-floated elements previously
occuring in the document.
right
[CSS1|CSS2|CSS2.1]
[IE4B2|N4B2|O3.5|S1]
Type: Explicit
Description:
The current element is shifted such that the top edge of the top
margin is below the bottom edge of any right-floated elements previously
occuring in the document.
both
[CSS1|CSS2|CSS2.1]
[IE4B2|N4B2|O3.5|S1]
Type: Explicit
Description:
The current element is shifted such that the top edge of the top
margin is below the bottom edge of any floated elements previously
occuring in the document.
Example
Ext/Doc: address {
clear: both }
In-Line: <addressSTYLE="clear:
both">This is a test document</address>
Notes
In CSS1 this property applied to all elements. CSS2 changes this, stating
that it should only be applied to block elements.
Browser Peculiarities
Internet Explorer
4.0+:
- This property does not always behave well with the 'float' property.
Netscape
4.x:
- This property doesn't behave particularly well with the 'float' property.
Opera
3.5:
- This property doesn't behave particularly well with the 'float' property.