flexbox_flex-natural.html (862B)
1 <!DOCTYPE html> 2 <title>flexbox | flex: larger integer</title> 3 <link rel="author" href="http://opera.com" title="Opera Software"> 4 <link rel="help" href="http://www.w3.org/TR/css-flexbox-1/#flex-common"> 5 <link rel="match" href="flexbox_flex-natural-ref.html"> 6 <style> 7 div { 8 background: blue; 9 margin: 1em 0; 10 border: 1px solid black; 11 height: 8em; 12 width: 800px; 13 14 display: flex; 15 } 16 span { 17 background: white; 18 margin: 1em 0; 19 width: 5em; 20 display: inline-block; 21 22 flex: 2; 23 } 24 #flex span { 25 flex: 666 1 0%; 26 } 27 span:nth-child(1) {background: yellow;} 28 span:nth-child(2) {background: pink;} 29 span:nth-child(3) {background: lightblue;} 30 span:nth-child(4) {background: grey;} 31 </style> 32 33 <div> 34 <span>one</span> 35 <span>two</span> 36 <span>three</span> 37 <span>four</span> 38 </div> 39 40 <div id="flex"> 41 <span>one</span> 42 <span>two</span> 43 <span>three</span> 44 <span>four</span> 45 </div>