Deniz Yazar
Deniz Yazar

Reputation: 379

Change the color of span on hover

Hello guys here is my code to change color on hover. I can change the color of every object except one. -> SPAN_3

<li id="LI_2">
      <span id="SPAN_3"></span> <fade>example text</fade>
</li>


    .price-box:hover fade {
       color: #fff;

    }
    **.price-box:hover span {
       color: #ffffff !important;
    }**

I cannot change the color of span. How can I fix this ? I searched the web but couldn't find with a solution.

Upvotes: 2

Views: 18642

Answers (3)

pradeep.gour
pradeep.gour

Reputation: 31

#SPAN_3{ color:#000;}
#LI_2{ color:#000;}
#LI_2:hover{ color:#ff0;}
#LI_2:hover{ color:#000;}

Upvotes: 0

J. Shabu
J. Shabu

Reputation: 1053

Here is your issue fixed code

<li id="LI_2">
      <span id="SPAN_3"><fade>example text</fade></span> 
</li>


#SPAN_3:hover{color:red;}
#SPAN_3{color:#000;}
    .price-box:hover fade {
       color: #fff;

    }
    **.price-box:hover span {
       color: #ffffff !important;
    }**

Upvotes: 3

code.rider
code.rider

Reputation: 1897

See its working

li span{
  color:red;
}
li:hover span{
  color:black
}
<li id="LI_2">
      <span id="SPAN_3">text for color change</span> <fade>example text</fade>
</li>

Upvotes: 2

Related Questions