Calling JavaScript from function from CSS

后端 未结 5 906
夕颜
夕颜 2020-12-14 08:18

Is there any way that I can call my JavaScript function from css?

For ex here is style:

.first-nav li a:hover,
.first-nav li.hover a {
    margin:-3         


        
5条回答
  •  执笔经年
    2020-12-14 08:54

    Because it's more logical to do it from CSS.

    If one wants to make links click on hover, it's an aesthetic quality and should be handled with CSS. For example:

    #header_menu li a:hover{
        color:white;
        js:click();
    }
    

提交回复
热议问题