CSSStyleProperties: cssFloat property

The cssFloat property of the CSSStyleProperties interface returns the CSS float property.

This is the result of invoking getPropertyValue() on the object with float as an argument.

When setting, it invokes 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.

Value

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 = "".

Example

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
.box {
  float: left;
  inline-size: 300px;
}
js
let myRules = document.styleSheets[0].cssRules;
let rule = myRules[0];
console.log(rule.style.cssFloat); // "left"
rule.style.cssFloat = "right";
console.log(rule.style.cssFloat); // "right"

Specifications

Specification
CSS Object Model (CSSOM)
# dom-cssstyleproperties-cssfloat

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
cssFloat
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 144 (Release date: 2025-10-14)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – Full support
Safari 26 (Release date: 2025-09-15)
footnote Full support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – Full support
Firefox for Android 144 (Release date: 2025-10-14)
footnote Full support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – Full support
Safari on iOS 26 (Release date: 2025-09-15)
footnote Full support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – Full support
WebView on iOS 26 (Release date: 2025-09-15)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support