SoFunction
Updated on 2025-04-07

Writing complex JavaScript scripts in CSS


Because the "{" and "}" in "{" and "}" conflict.
It seems that the quotes cannot be used, and there is no test.
In this way, writing scripts in CSS is not flexible, but what should I do if I want to write a complex script into CSS? This is a problem. After testing, I can first define a function and then call it in expression. However, since expression is used in CSS, it can only be run in IE.
Here is an example, click the code to run.

[Ctrl+A Select all Note:Introducing external Js requires refreshing the page before execution]