flexbox_justifycontent-center-ref.html (597B)
1 <!DOCTYPE html> 2 <title>flexbox | justify-content: 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: 8em; 10 width: 30em; 11 position: relative; 12 } 13 span { 14 background: yellow; 15 margin: 1em 0; 16 width: 6em; 17 max-width: 6em; 18 height: 6em; 19 position: absolute; 20 left: 4em; 21 display: inline-block; 22 } 23 span:nth-child(2) { 24 background: pink; 25 left: 12em; 26 } 27 span:nth-child(3) { 28 background: lightblue; 29 left: 20em; 30 } 31 </style> 32 33 <div> 34 <span>one</span> 35 <span>two</span> 36 <span>three</span> 37 </div>