The method of controlling CSS float attribute with JavaScript
This article focuses on "how to use JavaScript to control CSS float properties". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to use JavaScript to control CSS float properties".
Use JavaScript to control the float attribute of CSS
ExampleSourceCode
FunctiondivFloatRight (e) {e.style.backgroundColor = "# ff0000"; e.style.styleFloat = "right"; / / IE e.style.cssFloat = "right"; / / firefoxandothersexplorer} functiondivFloatLeft (e) {e.style.backgroundColor = "transparent"; e.style.styleFloat = "left"; e.style.cssFloat = "left";}