回答編集履歴
2
誤字修正
test
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
`z-index`では親子関係
|
1
|
+
`z-index`では親子関係を乗り越えて移動できないので、
|
2
2
|
`transform: translateZ`でZ方向の移動をさせたらどうでしょう。
|
3
3
|
|
4
4
|
```css
|
1
コード微修正
test
CHANGED
@@ -34,7 +34,7 @@
|
|
34
34
|
background: pink;
|
35
35
|
height: 200px;
|
36
36
|
width: 300px;
|
37
|
-
transform: perspective(
|
37
|
+
transform: perspective(none) translateZ(1px);
|
38
38
|
}
|
39
39
|
|
40
40
|
.black {
|
@@ -44,7 +44,7 @@
|
|
44
44
|
background: black;
|
45
45
|
height: 200px;
|
46
46
|
width: 300px;
|
47
|
-
transform: perspective(
|
47
|
+
transform: perspective(none) translateZ(0px);
|
48
48
|
transform-style: preserve-3d;
|
49
49
|
}
|
50
50
|
|
@@ -55,7 +55,7 @@
|
|
55
55
|
background: grey;
|
56
56
|
height: 200px;
|
57
57
|
width: 300px;
|
58
|
-
transform: perspective(
|
58
|
+
transform: perspective(none) translateZ(2px);
|
59
59
|
}
|
60
60
|
```
|
61
61
|
[CodePenサンプル](https://codepen.io/hatena19/pen/WNJrMoB)
|