问题
How can i make it work so that when i hover my li > a it also changes color on my glyphicon. I have listede below my html and what i tryed to do in css. But that does only change it if i hover the glyphicon and not the a. And yes i have also tryed to change it on my a but that dosen't effect my glyphicon.
Html:
<li class="pushy-item">
<a href="#">History
<span class="glyphicon glyphicon-list-alt opacityDown pull-right"></span>
</a>
</li>
Css:
ul > li > a > .glyphicon:hover{
color: orange;
}
`
回答1:
You can try this:
ul > li > a:hover > .glyphicon
回答2:
div > .glyphicon-heart:hover {
color: rgb(102, 102, 101);
cursor: pointer;
}
<div class = "heart">
<span class = "glyphicon"
[class.glyphicon-heart] = "isLiked"
(click) = "onClick()" >
</span>
</div>
来源:https://stackoverflow.com/questions/34967142/glyphicon-change-color-when-hover-a