Change color when hover a font awesome icon?

前端 未结 2 818
太阳男子
太阳男子 2020-12-05 13:11

Base in the Font Awesome documentation I create this icon:


  
  &         


        
相关标签:
2条回答
  • 2020-12-05 13:28

    if you want to change only the colour of the flag on hover use this:

    http://jsfiddle.net/uvamhedx/

    .fa-flag:hover {
        color: red;
    }
    <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
    
    <i class="fa fa-flag fa-3x"></i>

    0 讨论(0)
  • 2020-12-05 13:35

    use - !important - to override default black

    .fa-heart:hover{
       color:red !important;
    }
    .fa-heart-o:hover{
       color:red !important;
    }
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
    
    <i class="fa fa-heart fa-2x"></i>
    <i class="fa fa-heart-o fa-2x"></i>

    0 讨论(0)
提交回复
热议问题