position_07_absolute_positioning_relative.rml 983 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <rml>
  2. <head>
  3. <title>CSS Position: Absolute positioning - Relative</title>
  4. <link type="text/rcss" href="../style.rcss"/>
  5. <link rel="source" href="https://drafts.csswg.org/css-position-3/#comparison" />
  6. <link rel="help" href="https://drafts.csswg.org/css-position-3/#comparison" />
  7. <meta name="description" content='The "inner" text is positioned in an independent box, relative to the top-left corner of the start of the "outer" text.' />
  8. <style>
  9. body {
  10. font-size: 20dp;
  11. display: block;
  12. background: #ddd;
  13. color: #444;
  14. line-height: 200%;
  15. }
  16. #outer {
  17. position: relative;
  18. color: red
  19. }
  20. #inner {
  21. position: absolute;
  22. top: 200dp; left: -100dp;
  23. height: 130dp; width: 130dp;
  24. color: blue;
  25. }
  26. </style>
  27. </head>
  28. <body>
  29. <p>
  30. Beginning of p contents.
  31. <span id="outer"> Start of outer contents.
  32. <span id="inner"> Inner contents.</span>
  33. End of outer contents.</span>
  34. End of p contents.
  35. </p>
  36. <handle size_target="#document"/>
  37. </body>
  38. </rml>