Style Object
The cssFloat property sets or returns the horizontal alignment of an object.
Set the cssFloat property:
Return the cssFloat property:
| Value | Description |
|---|---|
| left | The object/element will float to the left in the parent element |
| right | The object/element will float to the right in the parent element |
| none | The object/element is not floated. This is default |
| inherit | The value of the cssFloat property is inherited from the parent element |
![]()
The cssFloat property is supported in all major browsers.
Note: The value "inherit" is not supported in IE7 and earlier. IE8 requires a !DOCTYPE. IE9 supports "inherit".
Note: If there is too little space on a line for the floating element, it will jump down to the next line that has enough space.
Let an image float to the left/right of the text, when clicking on two buttons:
Style Object
Your message has been sent to W3Schools.