float_basic.rml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <rml>
  2. <head>
  3. <title>Floats, block formatting contexts</title>
  4. <link type="text/rcss" href="../style.rcss"/>
  5. <link rel="help" href="https://www.w3.org/TR/CSS21/visufx.html#propdef-overflow" />
  6. <meta name="Description" content="Nesting divs should still hide overflow. Elements whose containing block is located above the 'overflow: hidden' element should be visible." />
  7. <meta name="See also" content="CSS 2.1 'clipping-' and 'overflow-' tests." />
  8. <style>
  9. body {
  10. background: #ddd;
  11. color: #444;
  12. }
  13. #content {
  14. width: 250dp;
  15. margin: 0 auto;
  16. }
  17. div.float {
  18. float: left;
  19. background-color: #bbb;
  20. border: 1dp #333;
  21. width: 100dp;
  22. height: 100dp;
  23. margin: 5dp;
  24. }
  25. .red {
  26. color: red;
  27. }
  28. </style>
  29. </head>
  30. <body>
  31. <p>This test makes assumptions about the font properties, that is, it depends on the size of the layed-out text.</p>
  32. <div id="content">
  33. <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod.
  34. <div class="float">float: left</div>
  35. <span class="red">This</span> is the first word after the float and should flow next to the float.</p>
  36. <p>This paragraph should flow next to the float.</p>
  37. <hr/>
  38. <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod.
  39. <div class="float">float: left</div>
  40. <span class="red">This</span> is the first word after the float and should flow next to the float.</p>
  41. <p style="clear: left;">This paragraph should be below the float as it clears the float.</p>
  42. <hr/>
  43. <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod.
  44. <div class="float">float: left</div>
  45. <span class="red">This</span> is the first word after the float and should flow next to the float.</p>
  46. <p style="overflow: auto;">This paragraph should establish a new block formatting context. This element's size and position should not overlap with the float, but still be located next to it.</p>
  47. </div>
  48. </body>
  49. </rml>