Align Label with Checkbox Cross-Browser in CSS


/ Published in: CSS
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <form>
  2. <div>
  3. <label><input type="checkbox" /> Label text</label>
  4. </div>
  5. </form>
  6.  
  7. <style type="text/css">
  8. label {
  9. display: block;
  10. padding-left: 15px;
  11. text-indent: -15px;
  12. }
  13. input {
  14. width: 13px;
  15. height: 13px;
  16. padding: 0;
  17. margin:0;
  18. vertical-align: bottom;
  19. position: relative;
  20. top: -1px;
  21. *overflow: hidden;
  22. }
  23. </style>

URL: http://stackoverflow.com/questions/306252/how-to-align-checkboxes-and-their-labels-consistently-cross-browsers

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.