summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-grid/grid-definition/flex-item-grid-container-percentage-rows-001.html
blob: ba655ce8a17d6482071d39e66684b50ebe749822 (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
<!DOCTYPE html>
<title>CSS Grid Layout Test: Percentage rows resolution in a flex item grid container</title>
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com">
<link rel="help" href="https://drafts.csswg.org/css-grid-1/#grid-item">
<link rel="help" href="https://drafts.csswg.org/css-flexbox/#definite-sizes">
<link rel="issue" href="https://bugs.chromium.org/p/chromium/issues/detail?id=617876">
<link rel="match" href="../reference/flex-item-grid-container-percentage-rows-001-ref.html">
<meta name="assert" content="This test ensures that percentage rows are properly resolved for a grid container that is a flex item with a definite height.">
<link rel="stylesheet" href="/css/support/grid.css">
<style>
.flex {
  display: flex;
  flex-direction: column;
  width: 200px;
  height: 200px;
  border: 5px solid;
}

.flexitem {
  flex: 1;
  background: magenta;
}

.grid {
  display: grid;
  grid: 50% / 1fr;
}

.griditem {
  background: cyan;
}
</style>

<p>Test passes if you see a 200x200 box with top half cyan and bottom half magenta.</p>

<div class="flex">
  <div class="flexitem grid">
    <div class="griditem"></div>
  </div>
</div>