flexbox-table-flex-items-2.html (1998B)
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 <meta charset="utf-8"> 9 <title> 10 CSS Test: Testing that implicit "flex-basis: content" on table wrapper box 11 doesn't prevent explicit table size from influencing flex base size. 12 </title> 13 <!-- XXXdholbert NOTE: This probably eventually should move to our 14 upstreamed reftest directory. But for now, this is just asserting 15 backwards-compatible/interoperable (but not necessary spec-compliant) 16 behavior, per https://github.com/w3c/csswg-drafts/issues/2604 --> 17 <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"> 18 <link rel="help" href="https://www.w3.org/TR/css-flexbox-1/#flex-base-size"> 19 <link rel="match" href="flexbox-table-flex-items-2.html"> 20 <style> 21 .container { 22 display: flex; 23 width: 100px; 24 border: 1px solid black; 25 } 26 27 /* Two types of flex items: */ 28 .table { 29 display: table; 30 border: 2px solid teal; 31 } 32 .block { 33 border: 2px solid brown; 34 } 35 36 /* Each flex item gets one of these as its contents, 37 to have a nonzero content size: */ 38 ib { 39 display: inline-block; 40 background: blue; 41 border: 1px solid gray; 42 width: 15px; 43 height: 10px; 44 } 45 </style> 46 </head> 47 <body> 48 <!-- auto size: --> 49 <div class="container"> 50 <div class="table"><ib></ib></div> 51 <div class="block"><ib></ib></div> 52 </div> 53 54 <!-- px size: --> 55 <div class="container"> 56 <div class="table" style="width: 30px"><ib></ib></div> 57 <div class="block" style="width: 30px"><ib></ib></div> 58 </div> 59 60 <!-- % size: --> 61 <div class="container"> 62 <div class="table" style="width: 30%"><ib></ib></div> 63 <div class="block" style="width: 30%"><ib></ib></div> 64 </div> 65 66 <!-- calc() size: --> 67 <div class="container"> 68 <div class="table" style="width: calc(10px + 20%)"><ib></ib></div> 69 <div class="block" style="width: calc(10px + 20%)"><ib></ib></div> 70 </div> 71 72 </body> 73 </html>