1. Home
  2. Computing & Technology
  3. Web Design / HTML

clear

By , About.com Guide

clear Description:

The clear property defines the sides of the element that should not float. It turns off the floating to that specific side.

clear in CSS Versions:
clear Syntax:

clear: none | left | right | both | inherit

  • none
    Floating elements are allowed on both sides.
  • left
    Floating elements are not allowed on the left.
  • right
    Floating elements are not allowed on the right.
  • both
    Floating elements are not allowed on either side.
  • inherit
    The element should have the same clear setting as the parent.
clear Initial Value:

none

clear Applies To:

All elements.

clear Inheritance:

This property is not inherited.

clear Browser Support:
clear Examples:

clear a right floating image

<p>
<img src="image.gif" alt="image" style="float: right;" />
This text will flow on the left side of the image.<br style="clear:right;" />
This text will display below the image.
</p>
clear Special Notes:
  • The cleared element will display directly below the floated element unless there are other layout styles in place.
More clear Information:

Return to the Style Library

Explore Web Design / HTML
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. CSS
  5. Style Properties
  6. CSS Style Property: clear>

©2009 About.com, a part of The New York Times Company.

All rights reserved.