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

andyhartleeds on 09/18/07


Tagged

css forms label tableless span


Versions (?)


Who likes this?

6 people have marked this snippet as a favorite

jonhenshaw
bartekk
vali29
marteki
jeff
gAmUssA


CSS tableless forms using labels and spans


Published in: CSS 


For creating forms without using tables, just CSS.

  1. label {
  2. display: block;
  3. width: 125px;
  4. float: left;
  5. padding: 5px;
  6. margin: 2px;
  7. clear: both;
  8. text-align: left;
  9. }
  10.  
  11. span {
  12. display: block;
  13. margin: 3px;
  14. }
  15.  
  16. span * {
  17. margin: 0;
  18. }

Report this snippet 

You need to login to post a comment.