summaryrefslogtreecommitdiff
path: root/Base/res/html/misc/flex-2.html
blob: 87e0ed8146d536a6791187d56dc5a6699ab6e008 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<!DOCTYPE html>
<html>

<head>
    <title>Flex 2: Electric Boogaloo</title>
    <style>
        .my-container {
            display: flex;
            border: 1px solid salmon;
        }

        .width-constrained {
            width: 250px;
        }

        .height-constrained {
            height: 250px;
        }

        .column {
            flex-direction: column;
        }

        .box {
            width: 100px;
            height: 100px;
            border: 1px solid black;
        }

        .exception {
            background: rgba(255, 0, 255, 0.5);
            left: 50px;
            top: 50px;
        }

        .width-constrained .exception {
            background: rgba(0, 255, 0, 0.5);
            left: 200px;
        }
    </style>
</head>

<body>
    <h1>FlexBox Tests</h1>
    <p>This tests whether flex-box behaves well with unusual children.</p>
    <p>The boxes are width and height 100px.</p>
    <h2>Row</h2>
    <h3>Width unconstrained</h3>
    <p>With a <code>position: absolute;</code> child</p>
    <div class="my-container">
        <div class="box">1</div>
        <div class="box exception" style="position: absolute;">Absolute</div>
        <div class="box">2</div>
        <div class="box">3</div>
    </div>
    <p>With a <code>position: fixed;</code> child</p>
    <div class="my-container">
        <div class="box">1</div>
        <div class="box exception" style="position: fixed;">Fixed</div>
        <div class="box">2</div>
        <div class="box">3</div>
    </div>
    <p>With a <code>position: relative;</code> child</p>
    <div class="my-container">
        <div class="box">1</div>
        <div class="box exception" style="position: relative;">Relative</div>
        <div class="box">2</div>
        <div class="box">3</div>
    </div>
    <p>With a <code>position: static;</code> child</p>
    <div class="my-container">
        <div class="box">1</div>
        <div class="box exception" style="position: static;">Static</div>
        <div class="box">2</div>
        <div class="box">3</div>
    </div>
    <p>With a <code>position: sticky;</code> child</p>
    <div class="my-container">
        <div class="box">1</div>
        <div class="box exception" style="position: sticky;">Sticky</div>
        <div class="box">2</div>
        <div class="box">3</div>
    </div>

    <h3>Width constrained</h3>
    <p>With a <code>position: absolute;</code> child</p>
    <div class="my-container width-constrained">
        <div class="box">1</div>
        <div class="box exception" style="position: absolute;">Absolute</div>
        <div class="box">2</div>
        <div class="box">3</div>
    </div>
    <p>With a <code>position: fixed;</code> child</p>
    <div class="my-container width-constrained">
        <div class="box">1</div>
        <div class="box exception" style="position: fixed;">Fixed</div>
        <div class="box">2</div>
        <div class="box">3</div>
    </div>
    <p>With a <code>position: relative;</code> child</p>
    <div class="my-container width-constrained">
        <div class="box">1</div>
        <div class="box exception" style="position: relative;">Relative</div>
        <div class="box">2</div>
        <div class="box">3</div>
    </div>
    <p>With a <code>position: static;</code> child</p>
    <div class="my-container width-constrained">
        <div class="box">1</div>
        <div class="box exception" style="position: static;">Static</div>
        <div class="box">2</div>
        <div class="box">3</div>
    </div>
    <p>With a <code>position: sticky;</code> child</p>
    <div class="my-container width-constrained">
        <div class="box">1</div>
        <div class="box exception" style="position: sticky;">Sticky</div>
        <div class="box">2</div>
        <div class="box">3</div>
    </div>

    <div style="height: 2000px"></div>
</body>

</html>