flex_05.rml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <rml>
  2. <head>
  3. <title>Flex 05 - Height constraints</title>
  4. <link type="text/rcss" href="../style.rcss"/>
  5. <link rel="match" href="reference/flex_05-ref.rml"/>
  6. <link rel="help" href="https://drafts.csswg.org/css-flexbox/" />
  7. <meta name="Description" content="The flex container should always respect (min-/max-) height constraints." />
  8. <style>
  9. h1 {
  10. text-align: center;
  11. margin-bottom: 5dp;
  12. padding: 0.25em 0;
  13. border-color: #333;
  14. border-width: 1dp 0;
  15. }
  16. h1:first-child { margin-top: 0; }
  17. h1, h2 { white-space: nowrap; }
  18. .flex {
  19. display: flex;
  20. margin: 1dp 0 3dp;
  21. border: 1dp #999;
  22. overflow: hidden;
  23. justify-content: space-around;
  24. align-items: flex-start;
  25. }
  26. .flex > div {
  27. border: 2dp #d66;
  28. background: #fff;
  29. text-align: center;
  30. }
  31. .wrap {
  32. flex-wrap: wrap;
  33. }
  34. .column {
  35. flex-direction: column;
  36. }
  37. .height {
  38. height: 40dp;
  39. }
  40. .min-height {
  41. min-height: 40dp;
  42. }
  43. .max-height {
  44. max-height: 40dp;
  45. }
  46. </style>
  47. </head>
  48. <body>
  49. <h1>height, rows</h1>
  50. <div class="flex wrap height">
  51. <div>Hello<br/>world!<br/>More<br/>Text</div><div>More Text</div>
  52. <div>Hello world!</div><div>More Text</div>
  53. </div>
  54. <div class="flex height">
  55. <div>Hello world!</div><div>More Text</div>
  56. </div>
  57. <h1>height, columns</h1>
  58. <div class="flex column wrap height">
  59. <div>Hello<br/>world!<br/>More<br/>Text</div><div>More Text</div>
  60. <div>Hello world!</div><div>More Text</div>
  61. </div>
  62. <div class="flex column height">
  63. <div>Hello<br/>world!</div><div>More<br/>Text</div>
  64. </div>
  65. <h1>min-height, rows</h1>
  66. <div class="flex wrap min-height">
  67. <div>Hello world!</div>
  68. </div>
  69. <div class="flex min-height">
  70. <div>Hello world!</div>
  71. </div>
  72. <h1>min-height, columns</h1>
  73. <div class="flex column wrap min-height">
  74. <div>Hello world!</div>
  75. </div>
  76. <div class="flex column min-height">
  77. <div>Hello world!</div>
  78. </div>
  79. <h1>max-height, rows</h1>
  80. <div class="flex wrap max-height">
  81. <div>Hello<br/>world!<br/>More<br/>Text</div>
  82. </div>
  83. <div class="flex max-height">
  84. <div>Hello<br/>world!<br/>More<br/>Text</div>
  85. </div>
  86. <h1>max-height, columns</h1>
  87. <div class="flex column wrap max-height">
  88. <div>Hello<br/>world!<br/>More<br/>Text</div><div>More<br/>Text</div>
  89. <div>Hello<br/>world!</div><div>More<br/>Text</div>
  90. </div>
  91. <div class="flex column max-height">
  92. <div>Hello<br/>world!</div><div>More<br/>Text</div>
  93. </div>
  94. <handle size_target="#document"/>
  95. </body>
  96. </rml>