CSS styling checkbox when checked - not working
I have the following static html file, where I’m spending time building a CMS web application site for our client.
In middle section, there’s a vertical array of checkboxes (which I css-styled it) and I followed numerous online tutorials, which lead me to use this site link.
I download the source code tutorial, understood it, copied the css code, tailor my changes as per my client requirements.
Everything looks perfectly fine - except when trying to check the checkbox.
The checkbox doesn’t get checked when clicked!
I couldn’t figure out why it’s not working as it’s supposed to be like the tutorial.
Can someone please tell me what I did wrong?
Here’s my code.
Thanks very much!
The CSS is fine. Your problem is matching the
label elements with the
This method relies on the fact that clicking the
label toggles the checkbox. If the
label isn’t attatched to the checkbox it won’t work. Match the value of each
for attribute to the
id of each checkbox.
<input type="checkbox" class="input-checkbox" id="checkbox1"> <label for="checkbox1" class="input-label"></label>