flexbox-basic-block-horiz-001.xhtml (2001B)
1 <?xml version="1.0" encoding="UTF-8"?> 2 <!-- 3 Any copyright is dedicated to the Public Domain. 4 http://creativecommons.org/publicdomain/zero/1.0/ 5 --> 6 <!-- Testcase with blocks as flex items in a horizontal flex container, with 7 various "flex" values and various combinations of the items. --> 8 <html xmlns="http://www.w3.org/1999/xhtml"> 9 <head> 10 <title>CSS Test: Testing flexbox layout algorithm property on block flex items in a horizontal flex container</title> 11 <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"/> 12 <link rel="help" href="http://www.w3.org/TR/css-flexbox-1/#layout-algorithm"/> 13 <link rel="match" href="flexbox-basic-block-horiz-001-ref.xhtml"/> 14 <style> 15 div { height: 100px; } 16 div.flexbox { 17 border: 1px dashed blue; 18 width: 200px; 19 font-size: 10px; 20 display: flex; 21 } 22 div.a { 23 flex: 1 0 30px; 24 background: lightgreen; 25 } 26 div.b { 27 flex: 2 0 20px; 28 background: yellow; 29 } 30 div.c { 31 flex: 3 0 40px; 32 background: orange; 33 } 34 div.flexNone { 35 flex: none; 36 background: pink; 37 } 38 div.flexBasis { 39 flex: 0 0 20px; 40 background: gray; 41 } 42 div.spacer { 43 display: inline-block; 44 width: 15px; 45 height: 15px; 46 background: purple; 47 } 48 </style> 49 </head> 50 <body> 51 <div class="flexbox"><div class="a"></div><div class="b"/></div> 52 <div class="flexbox"><div class="a"/><div class="c"/></div> 53 <div class="flexbox"><div class="a"/> 54 <div class="flexNone"><div class="spacer"/></div> 55 </div> 56 <div class="flexbox"><div class="b"/><div class="c"/></div> 57 <div class="flexbox"><div class="b"/> 58 <div class="flexNone"><div class="spacer"/><div class="spacer"/></div> 59 </div> 60 61 <div class="flexbox"> 62 <div class="a"/><div class="b"/><div class="flexBasis"/><div class="c"/> 63 </div> 64 </body> 65 </html>