I like Andrew's suggestion, and in fact the CSS rule should only be:
:checked + label { font-weight: bold; }
I like to rely on the implicit union of the label element and input , so I would do something like this:
<label> <input type="checkbox"/> <span>Bah</span> </label>
with CSS:
:checked + span { font-weight: bold; }
Example: http://jsfiddle.net/wrumsby/vyP7c/
Walter Rumsby Mar 27 '11 at 23:29 2011-03-27 23:29
source share