执行完代码后发现写在样式表中的hover效果失效,改了好几遍差点重新写函数,后来发现很简单,是优先级的问题,css()中的内容覆盖了之前的样式

只需要在样式后写!important即可解决!

1 .filters-wrap li:hover {  
2     background:#0085d7 !important;  
3 }  
4 .filters-wrap li:hover span {  
5     color:white !important;  
6 }  
 

执行完代码后发现写在样式表中的hover效果失效,改了好几遍差点重新写函数,后来发现很简单,是优先级的问题,css()中的内容覆盖了之前的样式

只需要在样式后写!important即可解决!

1 .filters-wrap li:hover {  
2     background:#0085d7 !important;  
3 }  
4 .filters-wrap li:hover span {  
5     color:white !important;  
6 }  

相关文章:

  • 2021-10-02
  • 2021-07-24
  • 2021-07-17
  • 2022-12-23
  • 2021-12-24
  • 2022-01-09
  • 2022-12-23
  • 2023-03-21
猜你喜欢
  • 2021-04-24
  • 2022-12-23
  • 2021-08-31
  • 2021-08-31
  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
相关资源
相似解决方案