flex-grow-002.html (1234B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Flexbox Test: flex-grow - 0(initial value)</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 initial value is '0', the flex item will keep the width when 'flex-grow' set '0'"> 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: 20px; 19 } 20 #test1 { 21 background-color: green; 22 flex-grow: 1; 23 } 24 #test2 { 25 background-color: green; 26 flex-grow: 0; 27 } 28 #cover { 29 background-color: green; 30 height: 100px; 31 margin-left: 80px; 32 margin-top: -100px; 33 width: 20px; 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 id="test3"></div> 42 </div> 43 <div id="cover"></div> 44 </body>