flex-shrink-004.html (1197B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Flexbox Test: flex-shrink - number(flex container has enough space)</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-shrink property is invalid when flex container has enough space to load flex items"> 9 <style> 10 #container { 11 background-color: red; 12 display: flex; 13 height: 100px; 14 width: 100px; 15 } 16 #container div { 17 background-color: green; 18 height: 100px; 19 width: 40px; 20 } 21 #test1 { 22 flex-shrink: 2; 23 } 24 #test2 { 25 flex-shrink: 3; 26 } 27 #cover { 28 background-color: green; 29 height: 100px; 30 margin-left: 80px; 31 margin-top: -100px; 32 width: 20px; 33 } 34 </style> 35 <body> 36 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 37 <div id="container"> 38 <div id="test1"></div> 39 <div id="test2"></div> 40 </div> 41 <div id="cover"></div> 42 </body>