inline_formatting_aligned_subtree.rml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <rml>
  2. <head>
  3. <title>Inline formatting - Aligned subtree</title>
  4. <link type="text/rcss" href="../style.rcss"/>
  5. <link rel="help" href="https://drafts.csswg.org/css2/#aligned-subtree" />
  6. <meta name="Description" content="Children of an inline element whose 'vertical-align' property is 'top', 'center', or 'bottom', is aligned relative to it." />
  7. <style>
  8. body {
  9. background: #ddd;
  10. color: #444;
  11. }
  12. .wrapper {
  13. border: 8px #bbb;
  14. margin-bottom: 2em;
  15. line-height: 2em;
  16. }
  17. span {
  18. border-color: #3332;
  19. border-width: 1px;
  20. background: #dfd;
  21. padding: 0.5em;
  22. }
  23. span.block {
  24. background: #fdf;
  25. display: inline-block;
  26. }
  27. .tall { line-height: 5em; }
  28. .large { line-height: 3em; }
  29. .medium { line-height: 1.5em; }
  30. .small { line-height: 1.2em; }
  31. .top { vertical-align: top; }
  32. .center { vertical-align: center; }
  33. .bottom { vertical-align: bottom; }
  34. .line-up { vertical-align: -100%; }
  35. .split { line-height: 2em; }
  36. .split span {
  37. line-height: 4em;
  38. border-width: 3px;
  39. padding: 0;
  40. vertical-align: top;
  41. }
  42. span.yellow, .yellow span { background-color: #ffd; }
  43. </style>
  44. </head>
  45. <body>
  46. <div class="wrapper">
  47. <span class="tall block">A</span>
  48. <span class="small top">
  49. B
  50. <span class="medium block bottom">C</span>
  51. D
  52. </span>
  53. <span class="large">
  54. E
  55. <span class="medium block">F</span>
  56. G
  57. </span>
  58. </div>
  59. <div class="wrapper">
  60. <span class="small top">
  61. A
  62. <span class="medium block bottom">B</span>
  63. <span class="bottom yellow">
  64. C
  65. <span class="line-up">
  66. D
  67. <span class="top">E</span>
  68. </span>
  69. </span>
  70. </span>
  71. <span class="tall block">F</span>
  72. </div>
  73. <div class="wrapper">
  74. <span class="small top">
  75. A
  76. <span class="medium block bottom">
  77. B
  78. <span class="bottom yellow">
  79. C
  80. <span class="line-up">
  81. D
  82. <span class="top">E</span>
  83. </span>
  84. </span>
  85. </span>
  86. </span>
  87. <span class="tall block">F</span>
  88. </div>
  89. <div class="wrapper">
  90. <span class="small bottom">
  91. A
  92. <span class="medium block center">
  93. B
  94. <span class="bottom yellow">
  95. C
  96. <span class="line-up">
  97. D
  98. <span class="center">E</span>
  99. </span>
  100. </span>
  101. </span>
  102. </span>
  103. <span class="tall block">F</span>
  104. </div>
  105. <div class="wrapper split">
  106. The following text <span>should wrap down to the<br/> next line</span> and produce borders on each line.
  107. </div>
  108. <handle size_target="#document"/>
  109. </body>
  110. </rml>