Remove ':hover' CSS behavior from element

后端 未结 6 1409
别那么骄傲
别那么骄傲 2020-11-29 16:57

I have CSS that changes formatting when you hover over an element.

HTML:

blah

CSS:

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-29 17:50

    I also had this problem, my solution was to have an element above the element i dont want a hover effect on:

    .no-hover {
      position: relative;
      opacity: 0.65 !important;
      display: inline-block;
    }
    
    .no-hover::before {
      content: '';
      background-color: transparent;
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: 60;
    }
    
    
    
    
      
    

提交回复
热议问题