flex-grow-004.html (1188B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Flexbox Test: flex-grow - (invalid when no space distributed)</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.1. The 'flex-grow' property" href="http://www.w3.org/TR/css-flexbox-1/#flex-grow-property"> 7 <link rel="match" href="../reference/ref-filled-green-100px-square.xht"> 8 <meta name="assert" content="The 'flex-grow' property is invalid when the flex container has no space distributed."> 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 } 19 #test1 { 20 flex-grow: 3; 21 width: 50px; 22 } 23 #test2 { 24 background-color: green; 25 flex-grow: 2; 26 width: 50px; 27 } 28 #cover { 29 background-color: green; 30 height: 100px; 31 position: relative; 32 top: -100px; 33 width: 50px; 34 } 35 </style> 36 <body> 37 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 38 <div id="container"> 39 <div id="test1"></div> 40 <div id="test2"></div> 41 </div> 42 <div id="cover"></div> 43 </body>