Get to know MDN better
Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
The cssFloat property of the CSSStyleDeclaration interface returns the result of invoking CSSStyleDeclaration.getPropertyValue() with float as an argument.
When setting, it invokes CSSStyleDeclaration.setProperty() with float as the first argument, and the given value as the second argument. The given value must be a valid value for the float property.
A string.
When set to the null value, that null value is converted to the empty string (""), so csd.cssFloat = null is equivalent to csd.cssFloat = "".
In the below example, the stylesheet contains a single rule for .box, which has the float property with a value of left. This value will be returned by cssFloat. We then set the value to "right" using cssFloat, and return the new value.
| CSS Object Model (CSSOM) # dom-cssstyleproperties-cssfloat |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Oct 4, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.