align-self-009.html (1415B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Flexbox Test: align-self - auto and align-items - center</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" href="http://www.w3.org/TR/css-flexbox-1/#align-items-property" title="8.3. Cross-axis Alignment: the 'align-items' and 'align-self' properties"> 7 <link rel="help" href="http://www.w3.org/TR/css-flexbox-1/#align-items-property" /> 8 <link rel="match" href="../reference/ref-filled-green-100px-square.xht"> 9 <meta name="assert" content="The 'align-self' property set 'auto' will center flex items the flex items in the cross axis when 'align-items' set 'center'"> 10 <style> 11 #test { 12 align-items: center; 13 background-color: red; 14 display: flex; 15 height: 100px; 16 width: 100px; 17 } 18 #test div { 19 align-self: auto; 20 background-color: green; 21 height: 50px; 22 width: 25px; 23 } 24 #top { 25 background-color: green; 26 margin-top: -100px; 27 height: 25px; 28 width: 100px; 29 } 30 #bottom { 31 background-color: green; 32 height: 25px; 33 margin-top: 50px; 34 width: 100px; 35 } 36 </style> 37 <body> 38 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 39 <div id="test"> 40 <div></div> 41 <div></div> 42 <div></div> 43 <div></div> 44 </div> 45 <div id="top"></div> 46 <div id="bottom"></div> 47 </body>