flexbox-baseline-single-item-001b.html (1893B)
1 <!DOCTYPE html> 2 <!-- 3 Any copyright is dedicated to the Public Domain. 4 http://creativecommons.org/publicdomain/zero/1.0/ 5 --> 6 <!-- Testcase for how we compute the baseline of a vertical flex container 7 with one flex item. This is the cross-axis baseline. The spec says this 8 about this case: 9 If the flex container has at least one flex item, and its 10 first flex item has a baseline parallel to the flex 11 container's cross axis, the flex container's cross-axis 12 baseline is that baseline. 13 --> 14 <html> 15 <head> 16 <title>CSS Test: Testing the baseline of a vertical flex container with one flex item</title> 17 <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"> 18 <link rel="help" href="http://www.w3.org/TR/css-flexbox-1/#flex-baselines"> 19 <link rel="match" href="flexbox-baseline-single-item-001-ref.html"> 20 <meta charset="utf-8"> 21 <style> 22 body { 23 font: 14px serif; 24 } 25 .flexContainer { 26 display: inline-flex; 27 flex-direction: column; 28 height: 16px; 29 width: 16px; 30 background: pink; 31 border: 0px dotted black; 32 /* (Elements that want a border will set their border-width.) */ 33 } 34 .abs { 35 position: absolute; 36 top: 0; 37 font-size: 8px; 38 } 39 </style> 40 </head> 41 <body> 42 A 43 <div class="flexContainer">a</div> 44 <div class="flexContainer" style="padding-bottom: 20px">a</div> 45 <div class="flexContainer" style="padding: 10px">a</div> 46 <div class="flexContainer" style="border-width: 3px">a</div> 47 <div class="flexContainer" style="border-bottom-width: 4px">a</div> 48 <div class="flexContainer" style="padding: 4px"> 49 <!-- (An abspos child shouldn't prevent us from getting our baseline from 50 the first flex item, which happens to be the second child.) --> 51 <div class="abs">abs</div> 52 <div style="font: 26px serif">a</div> 53 </body> 54 </html>