CSS GUIDE CLEAR

From CDOT Wiki
Jump to: navigation, search

This document is a work in progress and is subject to change.

Summary

Image and text elements that appear in another element are called floating elements. The clear property sets the sides of an element where other floating elements are not allowed.

Applicability:The clear property can be used for block-level elements.
Media Group: Visual
Inherited:No
Default Value:none

Syntax

TARGET_ELEMENT{clear: inhert !important}
TARGET_ELEMENT{clear: none}
TARGET_ELEMENT{clear: left}
TARGET_ELEMENT{clear: right}
TARGET_ELEMENT{clear: both}

Legal Values

ValueDescription
inheritExplicitly sets the value to that of the parent
noneAllows floating elements on both sides.
leftNo floating elements allowed on the left side.
rightNo floating elements allowed on the right side.
bothNo floating elements allowed on the left side or the right side.

Mozilla Recommended Values

Usage Examples

h1{
clear: none
}

h2{
clear: right
}

Notes

The clear property does not always work as expected if it is used along with the "float" property.

Specification Conformance

Browser Compatibility

  • Netscape 4, 6, 7
  • Mozilla 1
  • Firefox 1, 2
  • Internet Explorer 4, 5, 6

See Also