flex-004.htm (1897B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD//XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <title>CSS Test: Comparing two different elements using different values for the 'flex-shrink' sub-property on the 'flex' shorthand</title> 5 <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> 6 <link rel="help" href="http://www.w3.org/TR/css-flexbox-1/#flex-property" /> 7 <link rel="match" href="reference/justify-content-001-ref.html"> 8 <meta name="assert" content="This test checks that the flex items with a different flex shrink factor have different flexibilities."/> 9 <style type="text/css"> 10 div 11 { 12 height: 50px; 13 } 14 #flexbox 15 { 16 background-color: red; 17 display: flex; 18 width: 300px; 19 } 20 #flexItem1 21 { 22 flex: 0 2 auto; 23 width: 300px; 24 } 25 #flexItem2 26 { 27 flex: 0 3 auto; 28 width: 600px; 29 } 30 #flexItem1, #ref1 31 { 32 background-color: blue; 33 } 34 #flexItem2, #ref2 35 { 36 background-color: orange; 37 } 38 #ref1, #ref2 39 { 40 display: inline-block; 41 width: 150px; 42 } 43 </style> 44 </head> 45 <body> 46 <p>Test passes if there is a single blue rectangle on the left, a single orange rectangle directly to its right, and there is no red visible on the page.</p> 47 <div id="flexbox"> 48 <div id="flexItem1"></div> 49 <div id="flexItem2"></div> 50 </div> 51 <div id="ref1"></div><div id="ref2"></div> 52 </body> 53 </html>