Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 31 lines (17 sloc) 1.46 KB
layout title
post
This isn't Target Practice

Checkboxes are tiny. Labels are big(ger). This isn't target practice.

The Good:

   Check out this Pen! 
<script src="http://codepen.io/assets/embed/ei.js"> </script>

The Bad:

   Check out this Pen! 
<script src="http://codepen.io/assets/embed/ei.js"> </script>

The How:

We give the label a "for" attribute, where the value corresponds to the ID of the corresponding <input>

Uh oh! We just used an ID in our markup. I think this is ok, because we're not using the id selector for styling purposes (where IDs can be a pain in the class).

If for any reason you don't want to use IDs in your markup, you can just wrap the checkbox with the label:

   Check out this Pen! 
<script src="http://codepen.io/assets/embed/ei.js"> </script>
You can’t perform that action at this time.