質問編集履歴
3
stickeyスペルを直しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
|
8
8
|
|
9
|
-
id{sec-pr}にrelativeを指定し、.blockにstick
|
9
|
+
id{sec-pr}にrelativeを指定し、.blockにstickyを指定して
|
10
10
|
|
11
11
|
ぬるっとした動きにしています。
|
12
12
|
|
2
html css
test
CHANGED
File without changes
|
test
CHANGED
@@ -36,12 +36,12 @@
|
|
36
36
|
|
37
37
|
###HTML
|
38
38
|
|
39
|
+
```
|
40
|
+
|
39
41
|
|
40
42
|
|
41
43
|
<body>
|
42
44
|
|
43
|
-
<!-- starts PR -->
|
44
|
-
|
45
45
|
<section id="sec-pr">
|
46
46
|
|
47
47
|
<div class="block block-one">
|
@@ -76,16 +76,24 @@
|
|
76
76
|
|
77
77
|
</section>
|
78
78
|
|
79
|
-
<!-- end PR -->
|
80
|
-
|
81
79
|
</body>
|
82
80
|
|
83
81
|
|
84
82
|
|
85
83
|
|
86
84
|
|
85
|
+
|
86
|
+
|
87
|
+
```
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
87
93
|
#CSS
|
88
94
|
|
95
|
+
```ここに言語を入力
|
96
|
+
|
89
97
|
body{ border: 0;
|
90
98
|
|
91
99
|
font-size: 100%;
|
@@ -100,124 +108,102 @@
|
|
100
108
|
|
101
109
|
}
|
102
110
|
|
111
|
+
/*PR*/
|
112
|
+
|
103
|
-
c
|
113
|
+
#sec-pr{
|
104
|
-
|
114
|
+
|
105
|
-
|
115
|
+
width: 100%;
|
106
|
-
|
116
|
+
|
107
|
-
|
117
|
+
position: relative;
|
108
|
-
|
109
|
-
|
118
|
+
|
110
|
-
|
111
|
-
margin-top: 65px;
|
112
|
-
|
113
|
-
margin-top: 5.41667rem;
|
114
|
-
|
115
|
-
}
|
119
|
+
}
|
116
|
-
|
120
|
+
|
117
|
-
.
|
121
|
+
.block{
|
122
|
+
|
118
|
-
|
123
|
+
width: 100%;
|
124
|
+
|
125
|
+
height: 100vh;
|
126
|
+
|
127
|
+
display: flex;
|
128
|
+
|
129
|
+
position: -webkit-sticky;
|
130
|
+
|
131
|
+
position: sticky;
|
132
|
+
|
133
|
+
justify-content: center;
|
134
|
+
|
135
|
+
top: 50px;
|
136
|
+
|
137
|
+
}
|
138
|
+
|
139
|
+
.block-one{
|
140
|
+
|
141
|
+
background: #646d7a;
|
142
|
+
|
143
|
+
z-index: 100;
|
144
|
+
|
145
|
+
}
|
146
|
+
|
147
|
+
.block-two{
|
148
|
+
|
149
|
+
position: relative;
|
150
|
+
|
151
|
+
background: #64797a;
|
152
|
+
|
153
|
+
z-index: 200;
|
154
|
+
|
155
|
+
}
|
156
|
+
|
157
|
+
#sec-pr article.article02{
|
158
|
+
|
159
|
+
width: 73%;
|
160
|
+
|
161
|
+
position: absolute;
|
162
|
+
|
163
|
+
top: 10%;
|
164
|
+
|
165
|
+
left: 9vw;
|
166
|
+
|
167
|
+
}
|
168
|
+
|
169
|
+
#sec-pr .article01{
|
170
|
+
|
171
|
+
text-align: center;
|
172
|
+
|
173
|
+
}
|
174
|
+
|
175
|
+
#sec-pr .article02{
|
176
|
+
|
177
|
+
text-align: left;
|
178
|
+
|
179
|
+
}
|
180
|
+
|
181
|
+
#sec-pr .article01 h1{
|
182
|
+
|
183
|
+
color: #fff;
|
184
|
+
|
185
|
+
font-size: 4.2vw;
|
186
|
+
|
187
|
+
}
|
188
|
+
|
189
|
+
#sec-pr .article02 h1{
|
190
|
+
|
191
|
+
color: #fff;
|
192
|
+
|
193
|
+
font-size: 4.2vw;
|
194
|
+
|
195
|
+
}
|
196
|
+
|
197
|
+
/* ↓ ここがブラウザの高さを狭めると、.block-twoと同時に狭まない。.block-twoからはみ出てしまいます。 */
|
198
|
+
|
199
|
+
#sec-pr article.article03{
|
200
|
+
|
201
|
+
background: #212E32;
|
202
|
+
|
119
|
-
padding:
|
203
|
+
padding: 14% 6%;
|
120
204
|
|
121
205
|
margin: 0 auto;
|
122
206
|
|
123
|
-
}
|
124
|
-
|
125
|
-
sec-pr{
|
126
|
-
|
127
|
-
width: 100%;
|
128
|
-
|
129
|
-
position: relative;
|
130
|
-
|
131
|
-
}
|
132
|
-
|
133
|
-
.block{
|
134
|
-
|
135
|
-
width: 100%;
|
136
|
-
|
137
|
-
height: 100vh;
|
138
|
-
|
139
|
-
display: flex;
|
140
|
-
|
141
|
-
position: -webkit-sticky;
|
142
|
-
|
143
|
-
position: sticky;
|
144
|
-
|
145
|
-
justify-content: center;
|
146
|
-
|
147
|
-
top: 50px;
|
148
|
-
|
149
|
-
}
|
150
|
-
|
151
|
-
.block-one{
|
152
|
-
|
153
|
-
background: #646d7a;
|
154
|
-
|
155
|
-
z-index: 100;
|
156
|
-
|
157
|
-
}
|
158
|
-
|
159
|
-
.block-two{
|
160
|
-
|
161
|
-
position: relative;
|
162
|
-
|
163
|
-
background: #64797a;
|
164
|
-
|
165
|
-
z-index: 200;
|
166
|
-
|
167
|
-
}
|
168
|
-
|
169
|
-
sec-pr article.article02{
|
170
|
-
|
171
|
-
width: 73%;
|
172
|
-
|
173
|
-
position: absolute;
|
174
|
-
|
175
|
-
top: 10%;
|
176
|
-
|
177
|
-
left: 9vw;
|
178
|
-
|
179
|
-
}
|
180
|
-
|
181
|
-
sec-pr .article01{
|
182
|
-
|
183
|
-
text-align: center;
|
184
|
-
|
185
|
-
}
|
186
|
-
|
187
|
-
sec-pr .article02{
|
188
|
-
|
189
|
-
text-align: left;
|
190
|
-
|
191
|
-
}
|
192
|
-
|
193
|
-
sec-pr .article01 h1{
|
194
|
-
|
195
|
-
color: #fff;
|
196
|
-
|
197
|
-
font-size: 4.2vw;
|
198
|
-
|
199
|
-
}
|
200
|
-
|
201
|
-
sec-pr .article02 h1{
|
202
|
-
|
203
|
-
color: #fff;
|
204
|
-
|
205
|
-
font-size: 4.2vw;
|
206
|
-
|
207
|
-
}
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
/* ↓ ここがブラウザの高さを狭めると、.block-twoと同時に狭まない。.block-twoからはみ出てしまいます。 */
|
212
|
-
|
213
|
-
sec-pr article.article03{
|
214
|
-
|
215
|
-
background: #212E32;
|
216
|
-
|
217
|
-
padding: 14% 6%;
|
218
|
-
|
219
|
-
margin: 0 auto;
|
220
|
-
|
221
207
|
width: 70%;
|
222
208
|
|
223
209
|
-webkit-transform: translate(-50%, -50%);
|
@@ -233,3 +219,7 @@
|
|
233
219
|
left: 54vw;
|
234
220
|
|
235
221
|
}
|
222
|
+
|
223
|
+
/*end PR*/
|
224
|
+
|
225
|
+
```
|
1
relativeの表記を直しました
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
|
7
7
|
|
8
8
|
|
9
|
-
id{sec-pr}に
|
9
|
+
id{sec-pr}にrelativeを指定し、.blockにstickeyを指定して
|
10
10
|
|
11
11
|
ぬるっとした動きにしています。
|
12
12
|
|
@@ -26,7 +26,7 @@
|
|
26
26
|
|
27
27
|
|
28
28
|
|
29
|
-
stickyとposition:l
|
29
|
+
stickyとposition:relative,absoluteは同時に組み合わせることができるのでしょうか。
|
30
30
|
|
31
31
|
|
32
32
|
|