Posted By

mattvbiggs on 12/02/16


Tagged

css checkbox html5


Versions (?)

Aligning Checkbox with Label


 / Published in: CSS
 

Aligning a label with a checkbox can be tricky. Here is the HTML and CSS I used to achieve it.

  1. <!-- The HTML -->
  2. <div class="checkbox-label"><input type="checkbox" /><span>Remember me</span></div>
  3.  
  4. // The CSS
  5. .checkbox-label {
  6. display: inline;
  7. font-size: 12px;
  8. padding-left: 5px;
  9. }
  10.  
  11. .checkbox-label span {
  12. padding-left: 5px;
  13. padding-bottom: 15px;
  14. vertical-align: bottom;
  15. line-height: 22px;
  16. }

Report this snippet  

You need to login to post a comment.