float_overflow.rml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <rml>
  2. <head>
  3. <title>Floats: overflow</title>
  4. <link type="text/rcss" href="../style.rcss"/>
  5. <link rel="help" href="https://w3c.github.io/csswg-drafts/css2/#root-height" />
  6. <meta name="Description" content="Height of block formatting context roots with floated boxes inside." />
  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. <hr/>
  41. <div class="box" style="display: flow-root">
  42. <div class="float">float: left</div>
  43. <p>Using 'display: flow-root' on the containing '.box' element. This also establishes a new block formatting context, and should be equivalent to the previous box.</p>
  44. </div>
  45. <handle size_target="#document"/>
  46. </body>
  47. </rml>