flexbox-box-sizing-on-items-horiz-1-ref.html 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <!DOCTYPE html>
  2. <!--
  3. Any copyright is dedicated to the Public Domain.
  4. http://creativecommons.org/publicdomain/zero/1.0/
  5. -->
  6. <html>
  7. <head>
  8. <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
  9. <meta charset="utf-8">
  10. <style>
  11. .container {
  12. width: 100px;
  13. height: 30px;
  14. border: 1px solid black;
  15. float: left;
  16. margin: 2px;
  17. }
  18. .container > * {
  19. float: left; /* emulate the testcase's horizontal lineup of flex items */
  20. }
  21. .itemA {
  22. width: 22px;
  23. height: 22px;
  24. background: purple;
  25. border: 4px solid indigo;
  26. }
  27. .itemB {
  28. width: 40px;
  29. height: 20px;
  30. background: teal;
  31. border: 5px solid lightblue;
  32. }
  33. </style>
  34. </head>
  35. <body>
  36. <!-- FIRST ROW -->
  37. <!-- 1 inflexible item -->
  38. <div class="container">
  39. <div class="itemA"></div>
  40. </div>
  41. <!-- 1 flexible item -->
  42. <div class="container">
  43. <div class="itemA" style="width: 92px"></div>
  44. </div>
  45. <div style="clear: both"></div>
  46. <!-- SECOND ROW -->
  47. <!-- 2 inflexible items -->
  48. <div class="container">
  49. <div class="itemA"></div>
  50. <div class="itemB"></div>
  51. </div>
  52. <!-- 2 flexible items -->
  53. <div class="container">
  54. <div class="itemA" style="width: 32px"></div>
  55. <div class="itemB" style="width: 50px"></div>
  56. </div>
  57. </body>
  58. </html>