I am having trouble with setting the focus and active properties for an input element. Even after selecting a color, the highlight does not appear. However, the hover property is working fine.
Here is the code I have used to implement the highlight property for colors:
.highlightC:focus,
.highlightC:focus-visible,
.highlightC:visited {
border: 2px solid orange!important;
}
.highlightC:hover,
.highlightC:active {
border: 2px solid white;
}
.highlightC {
height: 20px;
width: 20px;
border-radius: 50%;
display: inline-block;
border: 2px solid transparent;
}
.color1 {
background-color: red;
}
.color2 {
background-color: green;
}
.color3 {
background-color: blue;
}
<div class="text-left mt-2">
<p class="tpColorsHeading ">Available colors</p>
<input type="radio" id="1" name="color" value="1" class="">
<label for="1" class="dot color1 highlightC"></label>
<input type="radio" id="2" name="color" value="2" class="">
<label for="2" class="dot color2 highlightC"></label>
<input type="radio" id="3" name="color" value="3" class="">
<label for="3" class="dot color3 highlightC"></label>
</div>