vertical alignment in forms with multiline labels (horizontal placement label - input)


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

this snippet is for this html structure

%form
%ol
%li
%label Label:
%input


Copy this code and paste it in your HTML
  1. li {
  2. display: inline-block;
  3. line-height: 0;
  4. }
  5.  
  6. label {
  7. display: inline-block;
  8. line-height: 1.5em;
  9. vertical-align: middle;
  10. }
  11.  
  12. input {
  13. display: inline-block;
  14. vertical-align: middle;
  15. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.