Skip to content

Instantly share code, notes, and snippets.

@Zmetser
Created November 26, 2012 12:07
Show Gist options
  • Save Zmetser/4147874 to your computer and use it in GitHub Desktop.
Save Zmetser/4147874 to your computer and use it in GitHub Desktop.
How to align checkboxes and their labels consistently cross browsers
<form>
<div>
<label><input type="checkbox" /> Label text</label>
</div>
<div>
<label><input type="checkbox" /> http://stackoverflow.com/questions/306252/how-to-align-checkboxes-and-their-labels-consistently-cross-browsers</label>
</div>
</form>
<style type="text/css">
label {
display: block;
padding-left: 15px;
text-indent: -15px;
}
input {
width: 13px;
height: 13px;
padding: 0;
margin:0;
vertical-align: bottom;
position: relative;
top: -1px;
*overflow: hidden;
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment