Set a:hover based on class

前端 未结 6 1354
星月不相逢
星月不相逢 2020-12-24 04:28

I have the following HTML:


      
6条回答
  •  醉梦人生
    2020-12-24 05:29

    One common error is leaving a space before the class names. Even if this was the correct syntax:

    .menu a:hover .main-nav-item
    

    it never would have worked.

    Therefore, you would not write

    .menu a .main-nav-item:hover
    

    it would be

    .menu a.main-nav-item:hover
    

提交回复
热议问题