clear

clear
CSS clear Property
The CSS clear property is used to clear space for an element that has preceding elements that are using the float property.
CSS CODE EXAMPLE
<style type="text/css">
#div1 {
    float: left;
    background: #F0F;
    width: 240px;
    height: 100px;
}
#div2 {
    clear: left;
    background: #0FF;
    width: 260px;
    height: 120px;
}
</style>
<div id="div1">div content ...</div>
<div id="div2">div content ...</div>
 
div content ...
div content ...
Just so you see can the contrast, I get the following results if I remove the clear property for the second element:
 
div content ...
div content ...

Possible Values:

left
Element will clear the left space of a preceding floating element.

right
Element will clear the right space of a preceding floating element.

both
Element will clear the space on both sides of a preceding floating element.

none
Element will not clear the space of a preceding floating element.

0 Response to "clear"

Post a Comment