回答編集履歴

1

サンプルを追記

2018/09/26 04:57

投稿

root_jp
root_jp

スコア4666

test CHANGED
@@ -1 +1,73 @@
1
1
  `z-index`に何も指定しなければ、後に書いた方が上にきます。
2
+
3
+
4
+
5
+ ```HTML
6
+
7
+ <div id="outer">
8
+
9
+ <div id="inner1"></div>
10
+
11
+ <div id="inner2"></div>
12
+
13
+ <div>
14
+
15
+ ```
16
+
17
+
18
+
19
+ ```CSS
20
+
21
+ html, body {
22
+
23
+ width: 100%;
24
+
25
+ height: 100%;
26
+
27
+ }
28
+
29
+
30
+
31
+ div {
32
+
33
+ width: 100%;
34
+
35
+ height: 100%;
36
+
37
+ }
38
+
39
+
40
+
41
+ #outer {
42
+
43
+ position: relative;
44
+
45
+ background-color: pink;
46
+
47
+ }
48
+
49
+
50
+
51
+ #inner1 {
52
+
53
+ position: absolute;
54
+
55
+ background-color: aqua;
56
+
57
+ }
58
+
59
+
60
+
61
+ #inner2 {
62
+
63
+ position: absolute;
64
+
65
+ background-color: lime;
66
+
67
+ top: 100px;
68
+
69
+ }
70
+
71
+
72
+
73
+ ```