|
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 baseline-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/css3-flexbox/#flex-baselines"> |
|
18 <link rel="match" href="flexbox-baseline-align-self-baseline-vert-1-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 display: -webkit-inline-flex; |
|
32 -webkit-flex-direction: column; |
|
33 background: lightblue; |
|
34 align-items: baseline; |
|
35 } |
|
36 .hugeAndUnaligned { |
|
37 font-size: 35px; |
|
38 line-height: 35px; |
|
39 /* This one flex item won't be baseline-aligned, so it won't impact |
|
40 the flex container's positioning */ |
|
41 align-self: stretch; |
|
42 } |
|
43 .smallFont { |
|
44 font-size: 10px; |
|
45 line-height: 10px; |
|
46 /* Baseline is 0.8em = 8px from top */ |
|
47 } |
|
48 </style> |
|
49 </head> |
|
50 <body> |
|
51 a |
|
52 <div class="flexContainer"> |
|
53 <div class="smallFont">b</div> |
|
54 <div>c</div> |
|
55 <div class="hugeAndUnaligned">d</div> |
|
56 </div> |
|
57 <div class="flexContainer"> |
|
58 <div class="hugeAndUnaligned">e</div> |
|
59 <div>f</div> |
|
60 <div class="smallFont">g</div> |
|
61 </div> |
|
62 <div class="flexContainer"> |
|
63 <div class="hugeAndUnaligned">h</div> |
|
64 <div class="smallFont">i</div> |
|
65 <div>j</div> |
|
66 </div> |
|
67 </body> |
|
68 </html> |