lithiumdoll: (Default)
lithiumdoll ([personal profile] lithiumdoll) wrote in [community profile] codebits2012-04-03 12:35 pm
Entry tags:

Label colour

HTML
<input type='radio' name='example' id='example1' value='1'> <label for='example1'>Option 1</label>
<input type='radio' name='example' id='example2' value='2'> <label for='example2'>Option 1</label>

CSS
input[type=radio]+label {
	color: red
	}
		
input[type=radio]:checked+label {
	color: green
	}
RESULT
Input label red when box unchecked, green when it is.