CSS hover selector for background-color not working after dynamic change of background-color with jquery

前端 未结 5 1216
臣服心动
臣服心动 2020-12-15 17:06

I dynamically change the background color of a div with the jquery .css() method. I also want to have a CSS hover selector on that same div that ch

5条回答
  •  星月不相逢
    2020-12-15 17:23

    A simple way would be to add the important tag to your CSS.

    div:hover {
        background-color: blue !important;
    };
    

提交回复
热议问题