shrink_to_fit_04.rml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <rml>
  2. <head>
  3. <title>Shrink-to-fit 4</title>
  4. <link type="text/rcss" href="../style.rcss"/>
  5. <link rel="help" href="https://www.w3.org/TR/CSS21/visudet.html#shrink-to-fit-float" />
  6. <meta name="Description" content="Shrink-to-fit should respect definite widths of inner elements. This also applies to flex containers and tables, even though we don't currently support shrink-to-fit layout for them." />
  7. <style>
  8. body {
  9. background: #ddd;
  10. color: #444;
  11. }
  12. body > div {
  13. float: left;
  14. clear: left;
  15. margin-top: 20dp;
  16. color: black;
  17. }
  18. .wrapper {
  19. border: 2dp #888;
  20. background: #f00;
  21. }
  22. .fixed {
  23. width: 100dp;
  24. padding: 10dp 5dp 10dp 15dp;
  25. box-sizing: border-box;
  26. background: #ccf;
  27. }
  28. .flex {
  29. display: flex;
  30. }
  31. </style>
  32. </head>
  33. <body>
  34. <p>The following boxes should all appear the same, with a border wrapped all the way around the background and no red visible.</p>
  35. <div>
  36. <div class="wrapper">
  37. <div class="fixed">Hello</div>
  38. </div>
  39. </div>
  40. <div>
  41. <div class="wrapper">
  42. <div>
  43. <div class="fixed">Hello</div>
  44. </div>
  45. </div>
  46. </div>
  47. <div>
  48. <div class="wrapper">
  49. <div class="flex fixed"><div>Hello</div></div>
  50. </div>
  51. </div>
  52. <div>
  53. <div class="wrapper">
  54. <div>
  55. <div class="flex fixed"><div>Hello</div></div>
  56. </div>
  57. </div>
  58. </div>
  59. <div>
  60. <div class="wrapper">
  61. <table class="fixed"><td>Hello</td></table>
  62. </div>
  63. </div>
  64. </body>
  65. </rml>