float_overflow.rml 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <rml>
  2. <head>
  3. <title>Floats: overflow</title>
  4. <link type="text/rcss" href="../style.rcss"/>
  5. <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#floats" />
  6. <meta name="Description" content="Floating boxes" />
  7. <style>
  8. body {
  9. background: #ddd;
  10. color: #444;
  11. }
  12. #content {
  13. width: 200dp;
  14. margin: 0 auto;
  15. }
  16. .box {
  17. background-color: #cce;
  18. border: 5dp #77b;
  19. }
  20. .float {
  21. float: left;
  22. background-color: #ddda;
  23. border: 1dp #333;
  24. width: 200dp;
  25. height: 130dp;
  26. margin: 5dp;
  27. }
  28. </style>
  29. </head>
  30. <body>
  31. <div class="box">
  32. <div class="float">float: left</div>
  33. <p>The float to the left should extend past the background of the containing '.box' element.</p>
  34. </div>
  35. <hr/>
  36. <div class="box" style="overflow:auto">
  37. <div class="float">float: left</div>
  38. <p>Using 'overflow: auto' on the containing '.box' element. This should establish a new block formatting context (thereby resolving all floats) so that the background wraps around the entire float.</p>
  39. </div>
  40. </body>
  41. </rml>