Created
November 26, 2012 12:07
-
-
Save Zmetser/4147874 to your computer and use it in GitHub Desktop.
How to align checkboxes and their labels consistently cross browsers
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
<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