Tableless forms


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



Copy this code and paste it in your HTML
  1. <form>
  2. <label for=”name”>Name</label>
  3. <input id=”name” name=”name”><br>
  4. <label for=”address”>Address</label>
  5. <input id=”address” name=”address”><br>
  6. <label for=”city”>City</label>
  7. <input id=”city” name=”city”><br>
  8. </form>
  9.  
  10. label,input {
  11. display: block;
  12. width: 150px;
  13. float: left;
  14. margin-bottom: 10px;
  15. }
  16.  
  17. label {
  18. text-align: right;
  19. width: 75px;
  20. padding-right: 20px;
  21. }
  22.  
  23. br {
  24. clear: left;
  25. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.