Am trying to duplicate this bootstrap effect

I really like this,

and have a bunch if images im trying to apply it to


The code seems to work fine if its a label, but since I have loads of images, the hover works fine but a tick doesn’t show up and nothing seems to be checked
I tried altering the css (changed label to img) but the HTML im using is

<input type="checkbox" />
<img src="images/test.jpg">	
...

Any ideas?

They label is necessary because of the for/id relation – just clicking an image won’t check the checkbox. You might just place the image inside the label though:

<input type="checkbox" id="checkbox-1">
<label for="checkbox-1">
  <img src="images/test.jpg" alt="test">
</label>
2 Likes

ok, thannks

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.