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

valcartei on 08/01/07


Tagged


Versions (?)


Who likes this?

7 people have marked this snippet as a favorite

jonhenshaw
Hirmine
basicmagic
Quizosde
vali29
aziz
marteki


Styling forms with definition lists


Published in: CSS 


  1. <form>
  2. <dl>
  3. <dt>Email:</dt>
  4. <dd><input type="text" name="email" /></dd>
  5. <dt>Name:</dt>
  6. <dd><input type="text" name="name" /></dd>
  7. </dl>
  8. </form>
  9.  
  10. /*CSS*/
  11. FORM DT {
  12. clear:both;
  13. width:33%;
  14. float:left;
  15. text-align:right;
  16. }
  17.  
  18. FORM DD {
  19. float:left;
  20. width:66%;
  21. margin:0 0 0.5em 0.25em;
  22. }

Report this snippet 

You need to login to post a comment.