Search within TutorialsPark

CSS float Property


To set the floating style for an element


Definition and Notes.

1. The CSS float property enables you to move an element to the left or right edge of the browser window, or the containing element

2.Elements that appear after the floated elements wrap around the floated element to fill the space.


Syntax:

CSS float property. internetexplorer safari firefox opera chrome

View in Splitscreen»

Code-Editor:

Note-As we can see the outside content wraps around the floating element, within all vacant space.

Property Values

Value Description
left The element is shifted such that the left edge touches the left edge of the containing block or the right edge of another floating block
right The element is shifted such that the right edge touches the right edge of the containing block or the left edge of another floating block
none The element is not floated at all. Its the default
inherit The float value for the parent element is inherited by the child element

Specifications

Specs Value
Name float
Value left | right | none | inherit
Initial Value none
Applies to All elements
Javascript syntax object.style.float="left"
Inherited no
Computed Value Same as declared value
Browser Support internetexplorer safari firefox opera chrome

Related Examples.