document_position.rml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <rml>
  2. <head>
  3. <title>Document position</title>
  4. <link type="text/rcss" href="../style.rcss"/>
  5. <link rel="help" href="https://drafts.csswg.org/css2/#abs-non-replaced-width" />
  6. <meta name="Description" content="Documents are positioned like absolutely positioned elements. The document should be centered. Moving and sizing the document and block should work as expected." />
  7. <style>
  8. handle[move_target] {
  9. top: 0;
  10. right: 0;
  11. left: 0;
  12. bottom: auto;
  13. height: 20px;
  14. width: auto;
  15. cursor: move;
  16. }
  17. body, div {
  18. border: 5dp #fff;
  19. padding-top: 2em;
  20. }
  21. body {
  22. text-align: center;
  23. z-index: 100;
  24. box-sizing: border-box;
  25. height: 400dp;
  26. bottom: 0;
  27. top: 0;
  28. margin-top: auto;
  29. margin-bottom: auto;
  30. width: 600dp;
  31. /* left: auto; */
  32. left: 0;
  33. right: 440dp;
  34. margin-left: auto;
  35. margin-right: auto;
  36. }
  37. div {
  38. position: absolute;
  39. z-index: 1;
  40. background: #eee;
  41. min-height: 50dp;
  42. bottom: 120dp;
  43. top: 0;
  44. margin-top: 120dp;
  45. margin-bottom: auto;
  46. left: 50%;
  47. right: 0;
  48. width: 150dp;
  49. margin-left: auto;
  50. margin-right: auto;
  51. }
  52. </style>
  53. </head>
  54. <body>
  55. <p>Document</p>
  56. <div>
  57. <p>Block</p>
  58. <handle move_target="#parent"/>
  59. <handle size_target="#parent"/>
  60. </div>
  61. <handle move_target="#parent"/>
  62. <handle size_target="#parent"/>
  63. </body>
  64. </rml>