1. For css attributes without a dash, generally use the style. attribute name directly.
Such as: obj.style.margin, obj.style.width, obj.style.left, obj.style.position, etc.
2. For CSS attributes containing underscores, remove each underscore and replace the first character after each underscore with uppercase letters.
Such as: obj.style.marginTop, obj.style.borderLeftWidth, obj.style.zIndex, obj.style.fontFamily, etc.
Because float is a reserved word in Javascript, how to write float in the style sheet in js?
We cannot use obj.style.float directly, as this operation is invalid.
The correct usage method is: IE: obj.style.styleFloat, other browsers such as Mozilla (gecko), ff, etc. use styleFloat: obj.style.cssFloat.