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

rduv on 10/20/06


Tagged


Versions (?)


Who likes this?

4 people have marked this snippet as a favorite

postNuKe
visualAesthetic
aziz
monapdx


feildset like div


Published in: CSS 


  1. div class="container">
  2. <p class="legend_lookalike">some text</p>
  3. <p>Some more text inside the div - as much as you want...</p>
  4. <p>Maybe some more text...</p>
  5. </div>
  6.  
  7. CSS:
  8. div.container {
  9. margin: 20px 0 0 0;
  10. border: solid 1px #555;
  11. background-color: #eee;
  12. width: auto;
  13. }
  14. div.container p {
  15. clear: left;
  16. margin: 6px 3px 6px 10px;
  17. }
  18.  
  19. div.container p.legend_lookalike {
  20. float: left;
  21. border: solid 1px #555;
  22. background-color: #fff;
  23. margin: -0.7em 0 0 10px;
  24. padding: 0 4px;
  25. position: relative;
  26. }
  27.  
  28. @media all {
  29. *html div.container,*html div.container p.legend_lookalike {
  30. height: 0;
  31. }

Report this snippet 

You need to login to post a comment.