stacking_context_01.rml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <rml>
  2. <head>
  3. <title>Stacking context and paint order</title>
  4. <link type="text/rcss" href="../style.rcss"/>
  5. <link rel="help" href="https://drafts.csswg.org/css2/#painting-order" />
  6. <meta name="Description" content="Stacking contexts are formed by 'z-index' and possibly other properties." />
  7. <style>
  8. .wrapper {
  9. margin: 15dp 0;
  10. }
  11. .box {
  12. border: 2dp #d66;
  13. background: #fff;
  14. text-align: center;
  15. width: 25dp;
  16. height: 22dp;
  17. }
  18. .flex {
  19. display: flex;
  20. flex-direction: column;
  21. }
  22. </style>
  23. </head>
  24. <body>
  25. <p>In the following, 'AA' should overflow and be painted over the 'B' boxes.</p>
  26. <div class="wrapper">
  27. <div class="box">A<br/>AA</div>
  28. <div class="box">B</div>
  29. </div>
  30. <div class="wrapper">
  31. <div class="box">A<br/>AA</div>
  32. <div class="box" style="position: relative; z-index: -1;">B</div>
  33. </div>
  34. <hr/>
  35. <p>In the following, 'B' boxes should be painted over the overflowing 'AA' text.</p>
  36. <div class="wrapper">
  37. <div class="box">A<br/>AA</div>
  38. <div class="box" style="position: relative;">B</div>
  39. </div>
  40. <div class="wrapper">
  41. <div class="box">A<br/>AA</div>
  42. <div class="box" style="position: relative; z-index: 0;">B</div>
  43. </div>
  44. <div class="wrapper">
  45. <div class="box">A<br/>AA</div>
  46. <div class="box" style="display: inline-block;">B</div>
  47. </div>
  48. <div class="wrapper flex" id="flex">
  49. <div class="box">A<br/>AA</div>
  50. <div class="box">B</div>
  51. </div>
  52. <handle size_target="#document"/>
  53. </body>
  54. </rml>