align-self-003.html (1341B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Flexbox Test: align-self - 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 'center' centered the flex items in the cross axis within the line"> 10 <style> 11 #test { 12 background-color: red; 13 display: flex; 14 height: 100px; 15 width: 100px; 16 } 17 #test div { 18 align-self: center; 19 background-color: green; 20 height: 50px; 21 width: 25px; 22 } 23 #top { 24 background-color: green; 25 margin-top: -100px; 26 height: 25px; 27 width: 100px; 28 } 29 #bottom { 30 background-color: green; 31 height: 25px; 32 margin-top: 50px; 33 width: 100px; 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="test"> 39 <div></div> 40 <div></div> 41 <div></div> 42 <div></div> 43 </div> 44 <div id="top"></div> 45 <div id="bottom"></div> 46 </body>