Little Web Hut

CSS 2.1 Reference: clear Property

CSS clear Property
Syntax
selector {clear: value;}
  • value is specified by using one of the following keywords: none, left, right, both, or inherit.
Usage

The clear property is used to specify that the side(s) of the element will be clear of any previous floating element boxes. This is accomplished by displaying the cleared element below the floating element boxes. Refer to the float property for more information on floating element boxes.

This property is specified by using a keyword according to the syntax shown above.


CSS Example: The clear property is set to clear the left side of some text from a left-floating image.
  #tst1 {clear: left;}
Test It HTML StyleTest It XHTML StyleTest It HTML5 Style

Keywords
  • none - The sides of the element will not be cleared of any previous floating element boxes.
  • left - The left side of the element will be clear of any previous left-floating element boxes.
  • right - The right side of the element will be clear of any previous right-floating element boxes.
  • both - Both sides of the element will be clear of any previous floating element boxes.
  • inherit - The inherit keyword is used to specify that the value for this property should be taken from the parent element. If inherit is used with the root element, then the initial value for this property will be used.
Applies To Block level elements
Inherited No
Initial Value none


clear Property Examples
Test It HTML StyleTest It HTML StyleTest It HTML5 StyleThe clear property is set to clear the left side of some text from a left-floating image.