Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

The method of controlling CSS float attribute with JavaScript

Shulou Source: shulou.com Published: 2022-05-31 11:45:17 10月27日 Update

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";}

Tags: Properties controls browsing methods content data servers learning support services practical deeper making a mountain out of a molehill two events actions information elements interests Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft macOS Redmi Huawei Docker