Glyphicon change color when hover a

痞子三分冷 提交于 2019-12-08 19:14:03

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!