flexbox_flex-0-N-auto-shrink.html (753B)
1 <!DOCTYPE html> 2 <title>flexbox | flex: 0 N auto | shrinking</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-property"> 5 <link rel="match" href="flexbox_flex-0-N-auto-shrink-ref.html"> 6 <style> 7 div { 8 background: blue; 9 margin: 1em 0; 10 border: 1px solid black; 11 height: 8em; 12 width: 16em; 13 14 display: flex; 15 } 16 span { 17 background: white; 18 margin: 1em 0; 19 width: 5em; 20 display: inline-block; 21 22 flex: 0 2 auto; 23 } 24 span:nth-child(1) {background: yellow;} 25 span:nth-child(2) {background: pink;} 26 span:nth-child(3) {background: lightblue;} 27 span:nth-child(4) {background: grey;} 28 </style> 29 30 <div> 31 <span>one</span> 32 <span>two</span> 33 <span>three</span> 34 <span>four</span> 35 </div>