You see,
digital information technology paved the way for the world wide web. Then, as the world wide web progressed over time, many tricks on website design and development have been formulated. With this, the pages of websites were made more accessible, usable, interactive, and visually appealing. One thing that made this happen was the formulation of the three layers of each page an internet site has.
Well, CSS is basically for the accessibility and customizability of the pages on the website. JavaScript, on the other hand, is for the interactivity and security of a website, and the transactions which are made on it, respectively. Then, there's XHTML acting as the glue which holds the two features together. Well, a platform to house the two is more likely.
But, the three layers always need to be separated. The XHTML layer or structural layer houses two layers. The CSS layer is one presentation layer. The third layer is called behavior layer and this uses JavaScript for its design and development. In order for these layers to communicate with each other, a trigger needs to be used. CSS triggers offer this function, but defeats the purpose of separating the three layers from each other. You see, these layers need to be stand-alone layers everytime a layer is modified. But, with CSS triggers, if you modify a layer, you would have to completely modify the HTML or structural layer. On the other hand,
JavaScript triggers offer a more suitable bridge for the communication gap between the layers. So, I advise you to employ JavaScript triggers than CSS triggers.