I am working with FontAwesome. I have a header consisting of some text next to an icon.
I would like both the text colour and the icon colour to transition simultaneously to black when the user hovers over either the text or the icon.
I can make the text colour change, but not the icon colour, and I don't understand why not.
This is my code:
.help-header {
color: red;
cursor: pointer;
transition: color 0.5s;
}
.help-header .fas {
color: red;
font-size: 16px;
transition: color 0.5s;
}
.help-header:hover {
color: black !important;
}
<link href="https://use.fontawesome.com/releases/v5.7.2/css/fontawesome.css" rel="stylesheet"/>
<link href="https://use.fontawesome.com/releases/v5.7.2/css/solid.css" rel="stylesheet"/>
<h4 class="help-header">
Help <i class="fas fa-question-circle"></i>
</h4>