Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@patocallaghan
Created June 20, 2012 11:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patocallaghan/2959450 to your computer and use it in GitHub Desktop.
Save patocallaghan/2959450 to your computer and use it in GitHub Desktop.
Handy checkbox alignment #css #forms #checkbox
/* Source: http://stackoverflow.com/questions/306252/how-to-align-checkboxes-and-their-labels-consistently-cross-browsers */
/*=====
<form>
<div>
<label><input type="checkbox" /> Label text</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