flex-basis-004.html (1217B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Flexbox Test: flex-basis - negative number(width 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 actual width of tested element is 9 same as the value of 'width' property specified."> 10 <style> 11 #container { 12 background-color: red; 13 display: flex; 14 height: 100px; 15 width: 100px; 16 } 17 #container div{ 18 background-color: green; 19 height: 100px; 20 } 21 #test { 22 flex-basis: -50px; 23 width: 30px; 24 } 25 #ref { 26 width: 50px; 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="test"></div> 40 <div id="ref"></div> 41 </div> 42 <div id="cover"></div> 43 </body>