回答編集履歴

2

一応強調しておきます。

2021/06/01 05:44

投稿

Lhankor_Mhy
Lhankor_Mhy

スコア36134

test CHANGED
@@ -74,7 +74,7 @@
74
74
 
75
75
  1. the in-flow, inline-level, non-positioned descendants, including inline tables and inline blocks.
76
76
 
77
- 1. the child stacking contexts with stack level 0 and the positioned descendants with stack level 0.
77
+ 1. the child stacking contexts with stack level 0 and **the positioned descendants with stack level 0**.
78
78
 
79
79
  1. the child stacking contexts with positive stack levels (least positive first).
80
80
 

1

補足欄を読んで追記

2021/06/01 05:43

投稿

Lhankor_Mhy
Lhankor_Mhy

スコア36134

test CHANGED
@@ -19,3 +19,65 @@
19
19
 
20
20
 
21
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
+ ```css
46
+
47
+ .article {
48
+
49
+ position: relative;
50
+
51
+ }
52
+
53
+ ```
54
+
55
+
56
+
57
+ > つまり、position: absolute (relative)を指定した時点で通常の要素より上にきて、z-index: autoの振る舞いをします。そのため、transformなどのスタッキングコンテキストの後にposition要素を配置した場合、スタッキングコンテキストでもないのにも関わらず、スタッキングコンテキストより上になります。
58
+
59
+ [君は真に理解しているか?z-indexとスタッキングコンテキストの関係 - ICS MEDIA](https://ics.media/entry/200609/)
60
+
61
+
62
+
63
+  
64
+
65
+ > Within each stacking context, the following layers are painted in back-to-front order:
66
+
67
+ 1. the background and borders of the element forming the stacking context.
68
+
69
+ 1. the child stacking contexts with negative stack levels (most negative first).
70
+
71
+ 1. the in-flow, non-inline-level, non-positioned descendants.
72
+
73
+ 1. the non-positioned floats.
74
+
75
+ 1. the in-flow, inline-level, non-positioned descendants, including inline tables and inline blocks.
76
+
77
+ 1. the child stacking contexts with stack level 0 and the positioned descendants with stack level 0.
78
+
79
+ 1. the child stacking contexts with positive stack levels (least positive first).
80
+
81
+ >
82
+
83
+ [Visual formatting model](https://www.w3.org/TR/CSS2/visuren.html#z-index)