Skip to content

Instantly share code, notes, and snippets.

@mgp
Created August 15, 2014 17:20
Show Gist options
  • Save mgp/588e890985c4574e2863 to your computer and use it in GitHub Desktop.
Save mgp/588e890985c4574e2863 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<style>
body > div {
border: 2px solid green;
padding: 50px;
margin: 10px
}
label, span {
padding: 40px;
}
label {
border: 2px dashed blue;
}
span {
border: 2px dashed red;
display: block:
}
</style>
</head>
<body>
<div>
<label>
nothing in span
<input type="checkbox" name="foo">
</label>
</div>
<div>
<label>
<span>
text in span
</span>
<input type="checkbox" name="bar">
</label>
</div>
<div>
<label>
input in span
<span>
<input type="checkbox" name="baz">
</span>
</label>
</div>
<div>
<input type="checkbox" id="quux">
<label for="quux">
label is sibling
</label>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment