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
| WEB HOSTING |
|---|
| Best Web Hosting |
| PHP MySQL Hosting |
| Best Hosting Coupons |
| UK Reseller Hosting |
| Cloud Hosting |
| Top Web Hosting |
| $3.98 Unlimited Hosting |
| Premium Website Design |
| WEB BUILDING |
|---|
| XML Editor - Free Trial! |
| FREE Website BUILDER |
| Best Website Templates Top CSS Templates |
| CREATE HTML Websites |
| EASY WEBSITE BUILDER |
| W3SCHOOLS EXAMS |
|---|
|
Get Certified in: HTML, CSS, JavaScript, XML, PHP, and ASP |
| W3SCHOOLS BOOKS |
|---|
|
New Books: HTML, CSS JavaScript, and Ajax |
| STATISTICS |
|---|
|
Browser Statistics Browser OS Browser Display |
| SHARE THIS PAGE |
|---|