OLD | NEW |
(Empty) | |
| 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 with |
| 7 several flex items, some of which have "align-self:baseline". Since we're |
| 8 vertical and the items' baselines are horizontal, they do not end up |
| 9 participating in baseline alignment, so their "align-self:baseline" |
| 10 computed style doesn't have any special effect on the container's |
| 11 baseline. |
| 12 --> |
| 13 <html> |
| 14 <head> |
| 15 <title>CSS Test: Testing the baseline of a vertical flex container with baseli
ne-aligned flex items</title> |
| 16 <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"> |
| 17 <link rel="help" href="http://www.w3.org/TR/css-flexbox-1/#flex-baselines"> |
| 18 <link rel="match" href="flexbox-baseline-align-self-baseline-vert-001-ref.html
"> |
| 19 <meta charset="utf-8"> |
| 20 <link rel="stylesheet" type="text/css" href="support/ahem.css" /> |
| 21 <style> |
| 22 body { |
| 23 margin: 0; |
| 24 font: 20px Ahem; |
| 25 line-height: 20px; |
| 26 /* Baseline is 0.8em = 16px from top */ |
| 27 } |
| 28 .flexContainer { |
| 29 display: inline-flex; |
| 30 flex-direction: column; |
| 31 background: lightblue; |
| 32 align-items: baseline; |
| 33 } |
| 34 .hugeAndUnaligned { |
| 35 font-size: 35px; |
| 36 line-height: 35px; |
| 37 /* This one flex item won't be baseline-aligned, so it won't impact |
| 38 the flex container's positioning */ |
| 39 align-self: stretch; |
| 40 } |
| 41 .smallFont { |
| 42 font-size: 10px; |
| 43 line-height: 10px; |
| 44 /* Baseline is 0.8em = 8px from top */ |
| 45 } |
| 46 </style> |
| 47 </head> |
| 48 <body> |
| 49 a |
| 50 <div class="flexContainer"> |
| 51 <div class="smallFont">b</div> |
| 52 <div>c</div> |
| 53 <div class="hugeAndUnaligned">d</div> |
| 54 </div> |
| 55 <div class="flexContainer"> |
| 56 <div class="hugeAndUnaligned">e</div> |
| 57 <div>f</div> |
| 58 <div class="smallFont">g</div> |
| 59 </div> |
| 60 <div class="flexContainer"> |
| 61 <div class="hugeAndUnaligned">h</div> |
| 62 <div class="smallFont">i</div> |
| 63 <div>j</div> |
| 64 </div> |
| 65 </body> |
| 66 </html> |
OLD | NEW |