Posted By

jpsirois on 01/19/10


Tagged

css html input checkbox label


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

codeclarified


Align Label with Checkbox Cross-Browser in CSS


 / Published in: CSS
 

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

  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>

Report this snippet  

You need to login to post a comment.