Venky559 Venky559 - 1 year ago 108
CSS Question

how to add styles to input radio element inside label is it possible?

<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<div class="radio-toolbar">
<label for="mylabel-1"><input type="radio" id="mybutton-1" checked>All</label>
<label for="mylabel-2"><input type="radio" id="mybutton-2" >Open</label>
<label for="mylabel-2"><input type="radio" id="mybutton-3" >Archived</label>

i want add css styles to input radio button inside label,i don't want to add css to outside label **
**is it possible?

Answer Source

Here is an example:

label input[type=radio]{ display:none; }

Further more ,you need to use this (use same name for radio buttons to select only one.Otherwise, it looks like checkboxes)

 <label for="mylabel-1"><input name="rd" type="radio" id="mybutton-1"  checked>All</label>
 <label for="mylabel-2"><input name="rd" type="radio" id="mybutton-2"  >Open</label>
 <label for="mylabel-2"><input name="rd" type="radio" id="mybutton-3"  >Archived</label>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download