Created
June 20, 2012 11:32
-
-
Save patocallaghan/2959450 to your computer and use it in GitHub Desktop.
Handy checkbox alignment #css #forms #checkbox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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