I have two radio buttons I want to give the same color as :hover
when :checked
. Can this be done using CSS or do I need an .active
class to toggle in JS?
#shopping-bag[data-toggle="buttons"] label:hover,
#shopping-bag[data-toggle="buttons"] label:checked {
color: #3b5998;
}
#rocket[data-toggle="buttons"] label:hover,
#rocket[data-toggle="buttons"] label:checked {
color: #d34836;
}
<link href="https://use.fontawesome.com/releases/v5.0.10/css/all.css" rel="stylesheet" />
<div class="btn-opt btn" id="shopping-bag" data-toggle="buttons">
<label class="radio shopbtn" for="shopbtn"><input id="shopbtn" name="toggler" type="radio"><i class="fa fa-fw fa-shopping-bag"></i> Deals</label>
</div>
<div class="btn-opt btn" id="rocket" data-toggle="buttons">
<label class="radio rocketbtn" for="rocketbtn"><input id="rocketbtn" name="toggler" type="radio"><i class="fa fa-fw fa-rocket"></i> Buzz</label>
</div>