質問編集履歴
1
質問内容が明確になるように、コードを簡素化しました。
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
[Airbnb模写]重なってしまいます
|
1
|
+
改[Airbnb模写]重なってしまいます
|
body
CHANGED
@@ -1,301 +1,105 @@
|
|
1
1
|
Airbnbの模写をしています。
|
2
2
|
https://www.airbnb.jp/host/homes
|
3
3
|
|
4
|
-
|
4
|
+
トップの画像と文字の関係がうまくいきません。
|
5
|
+
簡素化したコードを貼ります。
|
6
|
+
画面を狭くすると、position:absoluteでベージュの面にのせていた赤色の面を元の位置に戻し、代わりにベージュの面を下にもぐらせるイメージで作りました。しかし、後に続くはずのピンクの面がかぶさってしまいます。ピンクの面を赤(青)の面に続けたいのですが方法はありますか?
|
7
|
+
このやり方では無理であれば、Airbnbのやり方を知りたいのですが、検証で見ても複雑で、解説していただけないでしょうか。
|
5
8
|
|
6
9
|
それからsassの場合、メディアクエリの場所は後ろの方にまとめず要素ごとでいいのでしょうか?
|
7
10
|
|
8
11
|
よろしくお願いします。
|
9
12
|
|
13
|
+
|
10
14
|
```html
|
11
15
|
<body>
|
12
16
|
|
13
17
|
<section class="landing">
|
14
|
-
<div class="
|
18
|
+
<div class="img"></div>
|
15
|
-
</div>
|
16
|
-
<div class="
|
19
|
+
<div class="sqrRed">
|
17
|
-
<h2>
|
20
|
+
<h2>あいうえおかきくけこさしすせそたちつてとなにぬねのは</h2>
|
18
|
-
<div class="search-sp">
|
19
|
-
<div class="search-form">
|
20
|
-
<p>宿泊施設の内容を記入</p>
|
21
|
-
<input type="text" placeholder="ロケーション" />
|
22
|
-
|
21
|
+
<div class="sqrBlue">
|
23
|
-
<label class="lb staytype" for="staytype">
|
24
|
-
<select name="" id="staytype">
|
25
|
-
<option value="charter">まるまる貸切</option>
|
26
|
-
<option value="private">個室</option>
|
27
|
-
<option value="share">シェアルーム</option>
|
28
|
-
</select></label
|
29
|
-
>
|
30
22
|
|
31
|
-
<label class="lb people" for="people">
|
32
|
-
<select name="" id="people">
|
33
|
-
<option value="one">ゲスト1人</option>
|
34
|
-
<option value="two">ゲスト2人</option>
|
35
|
-
<option value="three">ゲスト3人</option>
|
36
|
-
<option value="four">ゲスト4人</option>
|
37
|
-
<option value="five">ゲスト5人</option>
|
38
|
-
<option value="six">ゲスト6人</option>
|
39
|
-
</select></label
|
40
|
-
>
|
41
|
-
</div>
|
42
|
-
<button>はじめる</button>
|
43
|
-
</div>
|
44
23
|
</div>
|
45
24
|
</div>
|
46
|
-
<div class="desc main-wrapper">
|
47
|
-
|
25
|
+
<div class="sqrPink">
|
48
|
-
<h3>なぜAirbnbでホスト?</h3>
|
49
|
-
<p>
|
50
|
-
どんなお家やお部屋でも、Airbnbなら簡単かつ安全にシェアして、世界中の旅好きな仲間とつながれます。
|
51
|
-
予約可能日から料金、ハウスルール、ゲストとの交流頻度まで、すべて自分で決めることができます。
|
52
|
-
</p>
|
53
|
-
</div>
|
54
|
-
<div class="sub-wrapper2">
|
55
|
-
<h3>困ったときも安心</h3>
|
56
|
-
<p>
|
57
|
-
万一に備えるUS$1,000,000の財物補償、US$1,000,000の賠償責任保険が全予約に自動付帯。ホストのみなさまと建物・家財の安全をお守りするため全力で取り組んでいます。
|
58
|
-
</p>
|
59
|
-
</div>
|
60
26
|
</div>
|
61
27
|
</section>
|
62
28
|
|
63
29
|
</body>
|
64
30
|
```
|
65
31
|
```sass
|
66
|
-
|
67
|
-
$green: #008489;
|
68
|
-
$blue: #006c70;
|
69
|
-
$yellow: #fdb32b;
|
70
|
-
$grey: #767676;
|
71
|
-
$red: #dd0f63;
|
72
32
|
body {
|
73
|
-
font-family: "メイリオ", "Meiryo", "MS PGothic";
|
74
|
-
font-size: 16px;
|
75
33
|
position: relative;
|
76
34
|
}
|
77
35
|
|
78
|
-
h1 {
|
79
|
-
font-size: 60px;
|
80
|
-
line-height: 64px;
|
81
|
-
font-weight: 900;
|
82
|
-
color: #333;
|
83
|
-
}
|
84
36
|
h2 {
|
85
37
|
font-size: 40px;
|
86
38
|
line-height: 40px;
|
87
39
|
font-weight: 800;
|
88
40
|
color: #333;
|
89
|
-
|
90
|
-
@media (max-width: 744px) {
|
91
|
-
font-size: 34px;
|
92
|
-
}
|
93
41
|
}
|
94
|
-
h3 {
|
95
|
-
font-size: 24px;
|
96
|
-
line-height: 1.25;
|
97
|
-
font-weight: 800;
|
98
|
-
color: #484848;
|
99
|
-
}
|
100
42
|
.container {
|
101
43
|
width: 1032px;
|
102
|
-
margin: 0 auto;
|
103
|
-
@media (max-width: 744px) {
|
104
|
-
padding: 0 25px;
|
105
|
-
}
|
106
44
|
}
|
107
|
-
.main-wrapper {
|
108
|
-
display: flex;
|
109
|
-
width: 1032px;
|
110
|
-
margin: 0 auto;
|
111
45
|
|
112
|
-
@media (max-width: 1128px) {
|
113
|
-
flex-direction: column;
|
114
|
-
width: 530px;
|
115
|
-
}
|
116
|
-
@media (max-width: 744px) {
|
117
|
-
width: 100%;
|
118
|
-
}
|
119
|
-
.sub-wrapper2 {
|
120
|
-
width: 50%;
|
121
|
-
padding-right: 80px;
|
122
|
-
@media (max-width: 1128px) {
|
123
|
-
width: 100%;
|
124
|
-
}
|
125
|
-
}
|
126
|
-
.sub-wrapper3 {
|
127
|
-
width: 33.3%;
|
128
|
-
padding-right: 56px;
|
129
|
-
@media (max-width: 1128px) {
|
130
|
-
width: 100%;
|
131
|
-
}
|
132
|
-
}
|
133
|
-
}
|
134
46
|
.landing {
|
135
|
-
margin-bottom: 100px;
|
136
|
-
padding-top: 83px;
|
137
|
-
|
138
|
-
@media (max-width: 1128px) {
|
139
|
-
padding-top: 0;
|
140
|
-
}
|
141
|
-
|
142
|
-
.
|
47
|
+
.img {
|
143
48
|
position: relative;
|
144
49
|
text-align: center;
|
145
50
|
margin: 0 auto;
|
146
|
-
background-
|
51
|
+
background-color: beige;
|
147
|
-
url(https://a0.muscache.com/4ea/air/v2/pictures/9d08d356-59b9-4ac4-9f41-5b9c13c2b211.jpg?t=r:w1440-h960-sfit,e:fwebp-c75);
|
148
52
|
width: 100%;
|
149
53
|
height: 600px;
|
150
|
-
background-position: top center;
|
151
|
-
background-repeat: no-repeat;
|
152
|
-
background-size: cover;
|
153
|
-
margin-bottom: 70px;
|
154
54
|
|
155
55
|
@media (max-width: 1128px) {
|
156
|
-
margin-bottom: 0px;
|
157
|
-
height: 0;
|
158
|
-
padding-top: 48%;
|
159
56
|
position: absolute;
|
160
57
|
z-index: -1;
|
161
58
|
}
|
162
|
-
|
163
|
-
@media (max-width: 744px) {
|
164
|
-
width: 100%;
|
165
|
-
}
|
166
59
|
}
|
167
|
-
.
|
60
|
+
.sqrRed {
|
168
61
|
position: absolute;
|
169
62
|
width: 460px;
|
170
63
|
height: 420px;
|
171
|
-
background-color:
|
64
|
+
background-color:red;
|
172
65
|
top: 140px;
|
173
66
|
right: 90px;
|
174
|
-
border
|
67
|
+
border: 2px solid red;
|
175
|
-
padding: 33px 0;
|
176
68
|
|
177
69
|
@media (max-width: 1128px) {
|
178
70
|
position: relative;
|
71
|
+
background-color: transparent;
|
179
72
|
width: 100%;
|
180
73
|
height: 100%;
|
181
|
-
padding: 0;
|
182
|
-
top:
|
74
|
+
top: 260px;
|
183
|
-
border-radius: 0;
|
184
|
-
background-color: transparent;
|
185
75
|
right: 0;
|
186
76
|
}
|
187
|
-
|
77
|
+
|
188
|
-
top: 140px;
|
189
|
-
}
|
190
78
|
h2 {
|
191
79
|
width: 400px;
|
192
80
|
margin: 0 auto 20px;
|
193
81
|
@media (max-width: 1128px) {
|
194
82
|
width: 100%;
|
195
83
|
color: #fff;
|
196
|
-
padding: 0 100px;
|
197
84
|
}
|
198
|
-
@media (max-width: 744px) {
|
199
|
-
padding: 0 25px;
|
200
|
-
}
|
201
85
|
}
|
202
|
-
.
|
86
|
+
.sqrBlue {
|
87
|
+
background-color: skyblue;
|
88
|
+
width: 90%;
|
89
|
+
height: 60%;
|
90
|
+
margin: 0 auto;
|
203
91
|
@media (max-width: 1128px) {
|
204
92
|
width: 100%;
|
205
|
-
|
93
|
+
height: 400px;
|
206
|
-
background-color: #fff;
|
207
94
|
}
|
208
|
-
@media (max-width: 744px) {
|
209
|
-
padding-left: 25px;
|
210
|
-
padding-right: 25px;
|
211
|
-
}
|
212
|
-
.search-form {
|
213
|
-
width: 400px;
|
214
|
-
margin: 0 auto;
|
215
|
-
@media (max-width: 1128px) {
|
216
|
-
max-width: 700px;
|
217
|
-
width: 100%;
|
218
|
-
z-index: auto;
|
219
|
-
}
|
220
|
-
@media (max-width: 744px) {
|
221
|
-
max-width: 100%;
|
222
|
-
}
|
223
|
-
p {
|
224
|
-
font-weight: 600;
|
225
|
-
}
|
226
|
-
input,
|
227
|
-
select {
|
228
|
-
border: 0.3px solid #ebebeb;
|
229
|
-
border-radius: 5px;
|
230
|
-
padding: 10px;
|
231
|
-
height: 48px;
|
232
|
-
@media (max-width: 744px) {
|
233
|
-
height: 38px;
|
234
|
-
font-size: 14px;
|
235
|
-
}
|
236
|
-
|
237
|
-
&:focus {
|
238
|
-
border-color: $blue;
|
239
|
-
}
|
240
|
-
}
|
241
|
-
input {
|
242
|
-
width: 100%;
|
243
|
-
margin-bottom: 10px;
|
244
|
-
}
|
245
|
-
.labels {
|
246
|
-
display: flex;
|
247
|
-
justify-content: space-between;
|
248
|
-
@media (max-width: 744px) {
|
249
|
-
flex-direction: column;
|
250
|
-
}
|
251
|
-
.staytype {
|
252
|
-
width: 58%;
|
253
|
-
@media (max-width: 744px) {
|
254
|
-
width: 100%;
|
255
|
-
margin-bottom: 10px;
|
256
|
-
}
|
257
|
-
}
|
258
|
-
.people {
|
259
|
-
width: 40%;
|
260
|
-
margin-bottom: 35px;
|
261
|
-
@media (max-width: 744px) {
|
262
|
-
width: 100%;
|
263
|
-
margin-bottom: 20px;
|
264
|
-
}
|
265
|
-
}
|
266
|
-
label {
|
267
|
-
position: relative;
|
268
|
-
select {
|
269
|
-
width: 100%;
|
270
|
-
}
|
271
|
-
&::before {
|
272
|
-
position: absolute;
|
273
|
-
content: "^";
|
274
|
-
font-size: 25px;
|
275
|
-
pointer-events: none;
|
276
|
-
transform: rotate(180deg);
|
277
|
-
right: 5%;
|
278
|
-
}
|
279
|
-
}
|
280
|
-
}
|
281
|
-
button {
|
282
|
-
text-align: center;
|
283
|
-
width: 100%;
|
284
|
-
height: 48px;
|
285
|
-
background-color: $red;
|
286
|
-
font-weight: 600;
|
287
|
-
color: #fff;
|
288
|
-
border-radius: 5px;
|
289
|
-
line-height: 48px;
|
290
|
-
}
|
291
|
-
}
|
292
95
|
}
|
293
96
|
}
|
294
|
-
|
97
|
+
|
295
|
-
.
|
98
|
+
.sqrPink {
|
296
99
|
background-color: pink;
|
297
|
-
|
100
|
+
height: 400px;
|
298
101
|
position: relative;
|
299
102
|
}
|
300
103
|
}
|
104
|
+
|
301
105
|
```
|