We Recommend

CSS: The Definitive Guide CSS: The Definitive Guide
Provides you with a comprehensive guide to CSS implementation, along with a thorough review of all aspects of CSS 2.1. Updated to cover Internet Explorer 7, Microsoft's vastly improved browser, this new edition includes content on positioning, text wrapping (nowrap), lists and generated content, table layout, user interface, paged media, and more.


Posted By

picale on 03/13/08


Tagged

form


Versions (?)


Who likes this?

7 people have marked this snippet as a favorite

arala22
Baris
SpinZ
gbot
mrjthethird
SmpleJohn
juke


Tableless forms


Published in: CSS 


  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
Posted By: SmpleJohn on May 6, 2008

Wow, I feel like an idiot right about... now. This is so easy, thanks.

You need to login to post a comment.