flexbox_align-items-center-2-ref.html (623B)
1 <!DOCTYPE html> 2 <title>flexbox | align-items: center</title> 3 <link rel="author" href="http://opera.com" title="Opera Software"> 4 <style> 5 div { 6 background: blue; 7 margin: 1em 0; 8 border: 1px solid black; 9 height: 6em; 10 width: 30em; 11 position: relative; 12 } 13 span { 14 background: yellow; 15 width: 8em; 16 height: 2em; 17 position: absolute; 18 top: 2em; 19 left: 1em; 20 display: inline-block; 21 } 22 span:nth-child(2) { 23 background: pink; 24 height: 3em; 25 top: 1.5em; 26 left: 11em; 27 } 28 span:nth-child(3) { 29 background: lightblue; 30 height: 4em; 31 top: 1em; 32 left: 21em; 33 } 34 </style> 35 36 <div> 37 <span>one</span> 38 <span>two</span> 39 <span>three</span> 40 </div>