flex-basis-003.html (1176B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Flexbox Test: flex-basis - negative number(width not specified)</title> 4 <link rel="author" title="Intel" href="http://www.intel.com"> 5 <link rel="author" title="Intel" href="mailto:shiyoux.tan@intel.com"> 6 <link rel="help" title="7.3.3. The 'flex-basis' property" href="http://www.w3.org/TR/css-flexbox-1/#flex-basis-property"> 7 <link rel="match" href="../reference/ref-filled-green-100px-square.xht"> 8 <meta name="assert" content="The 'flex-basis' property set negative number, the tested element is not shown when width not set either."> 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 #test { 20 flex-basis: -50px; 21 } 22 #ref { 23 background-color: green; 24 width: 50px; 25 } 26 #cover { 27 background-color: green; 28 height: 100px; 29 margin-left: 50px; 30 margin-top: -100px; 31 width: 50px; 32 } 33 </style> 34 <body> 35 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 36 <div id="container"> 37 <div id="test"></div> 38 <div id="ref"></div> 39 </div> 40 <div id="cover"></div> 41 </body>