Extensible HyperText Markup Language

XHTML.com recommends: PSD to HTML Slicing Service

clear

Definition

The clear property is used to prevent elements from wrapping around a floating element. The screen shot below shows how subsequent elements typically wrap around floating images.

Screen shot of a Web browser showing a heading. Underneath the heading is a left floating image. Wrapping around the floating image is some text, a heading, another left floating image and more text.

The screen shot below shows how wrapping around floating elements can be prevented by applying the clear property, set to both, to heading elements.

Screen shot of a Web browser showing a heading. Underneath the heading is a left floating image. Wrapping around the floating image is some text. Underneath the image, is another heading, followed by a left floating image with text wrapping around this image.

Example

  1. h1, h2, h3, h4, h5, h6 {clear: both}

Characteristics

Possible values

none
Wrap around floated elements.
left
Prevent wrapping around elements floated to the left.
right
Prevent wrapping around elements floated to the right.
both
Prevent wrapping around elements floated left or right.
inherit
Use the same computed value as the parent element for this property.

Default value

none

Applies to

Block-level elements

Inherited

No

See also