aboutsummaryrefslogtreecommitdiffhomepage
path: root/web/src/grid-area.html
blob: f3f4fdeb747fc7480ee1a24bac6d4959a5d3dd91 (plain) (blame)
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
<style>
.page-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  grid-template-areas:
      "h h"
      "s m"
      "f f";
  gap: 1em;
}
.gh {
  grid-area: h;
  background-color: orange;
}
.gs {
  grid-area: s;
  background-color: green;
}
.gm {
  grid-area: m;
  background-color: gray;
}
.gf {
  grid-area: f;
  background-color: yellow;
}
.nav-items {
  display: flex;                  /* flexbox model => flexible layout on row */
  justify-content: space-around;  /* align flex boxes horizontally with space around */
  align-items: center;            /* center flex items vertically */
  list-style: none;
}
p {
  margin: 1em;
}
</style>
<div class="page-grid">
  <div class="gh">
      <ul class="nav-items">
          <li class="nav-item"><a href="">aa</a></li>
          <li class="nav-item"><a href="">bb</a></li>
          <li class="nav-item"><a href="">cc</a></li>
      </ul>
  </div>
  <div class="gs">
    <p>Some text in the second column.</p>
  </div>
  <div class="gm">
    <p>Some text in the second column.</p>
  </div>
  <div class="gf">
    <p>Some text in the second column.</p>
  </div>
</div>