title: Pure CSS checkbox image replacement
body: <p>I've got a checkbox list in a table.  (one of a number of CB's on the row)</p>
  
  <pre><code> &lt;tr&gt;&lt;td&gt;&lt;input type="checkbox" class="custom_image" value="1" id="CB1" /&gt;&lt;label for='CB1'&gt;&amp;nbsp;&lt;/label&gt;&lt;/td&gt;&lt;/tr&gt;
   &lt;tr&gt;&lt;td&gt;&lt;input type="checkbox" class="custom_image" value="2" id="CB2" /&gt;&lt;label for='CB2'&gt;&amp;nbsp;&lt;/label&gt;&lt;/td&gt;&lt;/tr&gt;
   &lt;tr&gt;&lt;td&gt;&lt;input type="checkbox" class="custom_image" value="3" id="CB3" /&gt;&lt;label for='CB3'&gt;&amp;nbsp;&lt;/label&gt;&lt;/td&gt;&lt;/tr&gt;
   &lt;tr&gt;&lt;td&gt;&lt;input type="checkbox" class="custom_image" value="4" id="CB4" /&gt;&lt;label for='CB4'&gt;&amp;nbsp;&lt;/label&gt;&lt;/td&gt;&lt;/tr&gt;
  </code></pre>
  
  <p>I'd like to replace the checkbox image with a pair of custom on/off images and I was wondering if anyone had some better understanding of how to do this with CSS?</p>
  
  <p>I've found this "CSS ninja" tutorial, but I'll have to admit to finding it a bit complex for me.  <a href="http://www.thecssninja.com/css/custom-inputs-using-css" rel="noreferrer">http://www.thecssninja.com/css/custom-inputs-using-css</a></p>
  
  <p>As far as I can tell, you're allowed to use a pseudo class </p>
  
  <pre><code> td:not(#foo) &gt; input[type=checkbox] + label
   {
       background: url('/images/off.png') 0 0px no-repeat;
       height: 16px;
       padding: 0 0 0 0px;
   }
  </code></pre>
  
  <p>My expectation was that by adding the above CSS the checkbox would at least default to displaying the image in the OFF state and then I'd add the following to get the ON</p>
  
  <pre><code> td:not(#foo) &gt; input[type=checkbox]:checked + label {
       background: url('/images/on.png') 0 0px no-repeat;
   }
  </code></pre>
  
  <p>Unfortunately, it seems I'm missing a critical step somewhere.  I've tried to use the custom CSS3 selector syntax to match my current setup - but must be missing something (The images are size 16x16 if that matters)</p>
  
  <p><a href="http://www.w3.org/TR/css3-selectors/#checked" rel="noreferrer">http://www.w3.org/TR/css3-selectors/#checked</a></p>
  
  <p>EDIT:
  I'd been missing something in the tutorial where he applies the image change to the label and not the input itself.  I'm still not getting the expected swapped image for checkbox result on page, but think I'm closer.</p>