質問編集履歴

3

もとhtml

2018/04/18 10:12

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -11,6 +11,74 @@
11
11
  ### 追記
12
12
 
13
13
  ```html
14
+
15
+ <section class="p-about">
16
+
17
+ <ul class="columns">
18
+
19
+ <li class="column">
20
+
21
+ <div class="p-lp__title">
22
+
23
+ hoge
24
+
25
+ </div>
26
+
27
+ <div class="p-lp__subtitle">
28
+
29
+ piyo
30
+
31
+ </div>
32
+
33
+ <div class="p-lp__text">
34
+
35
+ foo
36
+
37
+ </div>
38
+
39
+ </li>
40
+
41
+ <li class="column">
42
+
43
+ <div class="p-about__image">
44
+
45
+ = image_tag(asset_pack_path("images/sp.png"))
46
+
47
+ </div>
48
+
49
+ </li>
50
+
51
+ </ul>
52
+
53
+ </section>
54
+
55
+ <section class="p-feature">
56
+
57
+ <div class="p-lp__title">
58
+
59
+ hoge
60
+
61
+ </div>
62
+
63
+ <div class="p-lp__subtitle">
64
+
65
+ piyo
66
+
67
+ </div>
68
+
69
+ <div class="p-lp__text">
70
+
71
+ foo
72
+
73
+ </div>
74
+
75
+ <div class="p-feature__list">
76
+
77
+ </section>
78
+
79
+
80
+
81
+ //slim
14
82
 
15
83
  section.p-about
16
84
 
@@ -123,3 +191,7 @@
123
191
  - cssはscss記法です。
124
192
 
125
193
  - ライブラリ?にbulmaを使用しています。
194
+
195
+ ### 追記3
196
+
197
+ 追記1にもとのhtmlを載せました。間違いなどあってはいけないと思い、slimも一応残してあります。

2

追記2

2018/04/18 10:12

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -115,3 +115,11 @@
115
115
  overflow: hidden;を消すと、手首と重なる位置に背景色が表示されるのですが、擬似クラスで回転させている要素がはみ出したままになります。
116
116
 
117
117
  稚拙な日本語ですみません。
118
+
119
+ ### 追記2
120
+
121
+ - テンプレートエンジンにslimを使用しています。
122
+
123
+ - cssはscss記法です。
124
+
125
+ - ライブラリ?にbulmaを使用しています。

1

追記

2018/04/18 09:50

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -5,3 +5,113 @@
5
5
  どのサイトをみても、"z-indexが効かない時はoverflowを入れていないかチェック!"みたいなことしかでてこず、なぜ両者は共存できないのか疑問です。
6
6
 
7
7
  疑問文ばかりですみません。根本的な原因?がわかる方いらっしゃいましたらご教授お願いします。
8
+
9
+
10
+
11
+ ### 追記
12
+
13
+ ```html
14
+
15
+ section.p-about
16
+
17
+ ul.columns
18
+
19
+ .column
20
+
21
+ .p-lp__title
22
+
23
+ | hoge
24
+
25
+ .p-lp__subtitle
26
+
27
+ | piyo
28
+
29
+ .p-lp__text
30
+
31
+ | foo
32
+
33
+ .column
34
+
35
+ .p-about__image
36
+
37
+ = image_tag(asset_pack_path("images/sp.png"))
38
+
39
+ section.p-feature
40
+
41
+ .p-lp__title
42
+
43
+ | hoge
44
+
45
+ .p-lp__subtitle
46
+
47
+ | piyo
48
+
49
+ .p-lp__text
50
+
51
+ | foo
52
+
53
+ .p-feature__list
54
+
55
+
56
+
57
+ ```
58
+
59
+ ```css
60
+
61
+ .p-about {
62
+
63
+ position: relative;
64
+
65
+ z-index: -2;
66
+
67
+ }
68
+
69
+
70
+
71
+ .p-feature {
72
+
73
+ position: relative;
74
+
75
+ overflow: hidden;
76
+
77
+ z-index: -1;
78
+
79
+ }
80
+
81
+ .p-feature:before {
82
+
83
+ content: '';
84
+
85
+ position: absolute;
86
+
87
+ top: 0;
88
+
89
+ left: 0;
90
+
91
+ width: 120%;
92
+
93
+ height: 110%;
94
+
95
+ margin: -6% -10% 0;
96
+
97
+ background: $color-background;
98
+
99
+ transform-origin: left center;
100
+
101
+ transform: rotate(-3deg);
102
+
103
+ z-index: -1;
104
+
105
+ }
106
+
107
+ ```
108
+
109
+ ![イメージ説明](e3a3cd9f73d9ca99b97229711890c870.png)
110
+
111
+ 画像が非常に見辛いですが、青色の部分を前面にだして重なりを表現したいのです。
112
+
113
+ overflow: hidden;を指定すると、おそらくですが、画像の後ろ側に擬似クラスの部分が隠れてしまっていると思います。
114
+
115
+ overflow: hidden;を消すと、手首と重なる位置に背景色が表示されるのですが、擬似クラスで回転させている要素がはみ出したままになります。
116
+
117
+ 稚拙な日本語ですみません。