flex-grow-003.html (1159B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Flexbox Test: flex-grow - negative number</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 set negative number, the flex item will not grow."> 9 <style> 10 #container { 11 background-color: green; 12 display: flex; 13 height: 100px; 14 width: 100px; 15 } 16 #container div { 17 background-color: red; 18 height: 100px; 19 } 20 #test1 { 21 flex-grow: -2; 22 width: 25px; 23 } 24 #test2 { 25 flex-grow: -3; 26 width: 25px; 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>