Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

How to Style a Selected Radio Buttons Label?

<style>
.radio-block input[type="radio"]:checked + label {
  background-color: red;
}
</style>

<div class="radio-block">
  <input type="radio" id="radio1" name="radios" value="on">
  <label for="radio1">On</label>

  <input type="radio" id="radio2" name="radios" value="off" checked>
  <label for="radio2">Off</label>
</div>
 
PREVIOUS NEXT
Tagged: #How #Style #Selected #Radio #Buttons
ADD COMMENT
Topic
Name
2+7 =