Fri, 16 Jan 2015 18:13:44 +0100
Integrate suggestion from review to improve consistency with existing code.
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 for behavior of the 'baseline' value for align-items (and
7 align-self, implicitly), in a multi-line flex container.
8 This test baseline-aligns variously-sized flex items, and the container's
9 vertical size depends on the aggregate post-alignment height of its items.
10 -->
11 <html xmlns="http://www.w3.org/1999/xhtml">
12 <head>
13 <title>CSS Test: Baseline alignment of block flex items with 'baseline' value for 'align-items' / 'align-self' in a multi-line flex container</title>
14 <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"/>
15 <link rel="help" href="http://www.w3.org/TR/css3-flexbox/#baseline-participation"/>
16 <link rel="match" href="flexbox-align-self-baseline-horiz-4-ref.xhtml"/>
17 <style>
18 .flexbox {
19 display: flex;
20 flex-wrap: wrap;
21 align-items: baseline;
22 width: 90px;
23 }
25 .flexbox > * {
26 width: 28px; /* 3 items per Flex Line */
27 background: yellow;
28 border: 1px solid black;
29 }
31 .big { font: 24px sans-serif; }
32 .medium { font: 14px sans-serif; }
33 .small { font: 8px sans-serif; }
35 </style>
36 </head>
37 <body>
38 <div class="flexbox">
39 <!-- First flex line: Just 3 different sizes of text -->
40 <div class="big">a</div>
41 <div class="small">b</div>
42 <div class="medium">c</div>
44 <!-- Second flex line: different margin/padding amounts on each item,
45 and one non-baseline-aligned item.-->
46 <div class="medium" style="padding-top: 10px">d</div>
47 <div class="medium" style="margin-bottom: 8px">e</div>
48 <div class="medium" style="align-self: stretch">f</div>
50 <!-- Third flex line: other margin/padding amounts on each item -->
51 <div class="small" style="margin-top: 20px">g</div>
52 <div class="big">h</div>
53 <div class="medium" style="padding-bottom: 6px">i</div>
54 </div>
55 </body>
56 </html>