Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
After multiple tries I failed to make changing colors of border box of radio and check buttons on hovering and checking. Should look like this https://d2gg9evh47fn9z.cloudfront.net/800px_COLOURBOX14580391.jpg
and
https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ46PHlg5TAe25SBGsRZcQMPBz_ZZYGJptpDz3004sA0eFKr83K

What I have tried:

CSS
.checkbox:hover
{
   background-color: #009901;
}

.radio:hover
{
   background-color: #009901;
}

input[type='checkbox']:hover:after, input[type='checkbox']:checked:hover:after {
	background: transparent;
	content: '\2713';
	color: #009901;
}

input[type='checkbox']:checked:after {
	background: transparent;
	content: '\2713';
	color: #009901;
}

input[type='radio']:hover:after, input[type='radio']:checked:hover:after {
	background: transparent;

	color: #009901;
}

input[type='radio']:checked:after {
	background: transparent;
	
	color: #009901;


HTML
<div class = "right ">
	
  <br>
                    <label class="container">Always</label>
                    <input type="radio" id="a" name="feature" value="true">
                    <label class="container">Sometimes</label>
                    <input type="radio" id="s" name="feature" value="false" />
					<label class="container">Never</label>
                    <input type="radio" id="n" name="feature" value="false" /><br><br>
					
                
          
			
               
                Days<br>
                    <label >Sun</label>
                    <input type="checkbox" id="sun" name="feature" value="true">
                    <label >Mon</label>
                    <input type="checkbox" id="mon" name="feature" value="false" />
					<label >Tue</label>
                    <input type="checkbox" id="tue" name="feature" value="false" />
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900