flex-shrink-006.html (1264B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Flexbox Test: flex-shrink - 0(one of flex-shrinks sets 0, another not)</title> 4 <link rel="author" title="Intel" href="http://www.intel.com"> 5 <link rel="author" title="Shiyou Tan" href="mailto:shiyoux.tan@intel.com"> 6 <link rel="help" title="7.3.2. The 'flex-shrink' property" href="http://www.w3.org/TR/css-flexbox-1/#flex-shrink-property"> 7 <link rel="match" href="../reference/ref-filled-green-100px-square.xht"> 8 <meta name="assert" content="The flex item whose flex-shrink property of set 0 will displayed on the top of all flex items"> 9 <style> 10 #container { 11 background-color: red; 12 display: flex; 13 height: 100px; 14 width: 100px; 15 } 16 #container div { 17 height: 100px; 18 width: 100px; 19 } 20 #test1 { 21 background-color: green; 22 flex-shrink: 0; 23 } 24 #test2 { 25 background-color: yellow; 26 flex-shrink: 0.1; 27 } 28 #test3 { 29 background-color: blue; 30 flex-shrink: 2; 31 } 32 #test2 { 33 background-color: black; 34 flex-shrink: 3; 35 } 36 </style> 37 <body> 38 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 39 <div id="container"> 40 <div id="test1"></div> 41 <div id="test2"></div> 42 <div id="test3"></div> 43 <div id="test4"></div> 44 </div> 45 </body>