-1

I'm trying to make an icon change color when hover it, but don't work. I tried using id cuz i'm using more icons so that make it easy, but i'm not sure if this is the correct way :D HTML

<div class='col5'>
            <h5>NE GASESTI PE</h5>
            <i class="fab fa-facebook" id='fb'></i>
        </div>
#fb {
    padding-left: 15px;
    font-size: 40px;
    color: gray;
}

#fb :hover {
    color: blue;
}

1 Answers1

0

Remove space in #fb :hover { like #fb:hover {

#fb {
  padding-left: 15px;
  font-size: 40px;
  color: gray;
}

#fb:hover {
  color: blue;
}
<div class='col5'>
  <h5>NE GASESTI PE</h5>
  <i class="fab fa-facebook" id='fb'>icon</i>
</div>
Aleksandr Belugin
  • 2,149
  • 1
  • 13
  • 19