質問編集履歴

1

追加情報

2020/06/01 02:26

投稿

augsup
augsup

スコア7

test CHANGED
File without changes
test CHANGED
@@ -4,6 +4,288 @@
4
4
 
5
5
  これを2枚目の写真のようにmainの画像と被らずに固定するにはどうすればいいのでしょうか?
6
6
 
7
+ 私が書いたコードも載せておきます。
8
+
7
9
  ![イメージ説明](c324e87f4bab4b5c37bee742b7e1409a.png)
8
10
 
9
11
  ![イメージ説明](550a1865802537795bb437c6841f510d.png)
12
+
13
+ ```HTML
14
+
15
+ <!DOCTYPE html>
16
+
17
+ <html lang="ja">
18
+
19
+ <head>
20
+
21
+ <meta charset="UTF-8">
22
+
23
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
24
+
25
+ <title>Airbnbでお家、アパート、お部屋をシェアしよう</title>
26
+
27
+ <link rel="stylesheet" href="css/stylesheet.css">
28
+
29
+ </head>
30
+
31
+ <body>
32
+
33
+ <header>
34
+
35
+ <div class="header-ctn-left">
36
+
37
+ <img src="img/head.svg" alt="">
38
+
39
+ <a href="">概要</a>
40
+
41
+ <a href="">準備</a>
42
+
43
+ <a href="">安全</a>
44
+
45
+ <a href="">マネープラン</a>
46
+
47
+ </div>
48
+
49
+ <button type="button">はじめる</button>
50
+
51
+ </header>
52
+
53
+ <main>
54
+
55
+ <section class="eyecatch">
56
+
57
+ <div class="eyecatch-ctn">
58
+
59
+ <p>Airbnbホストになって、暮らしをレベルアップ</p>
60
+
61
+ <p>宿泊施設の内容を記入</p>
62
+
63
+ <input type=" text " placeholder="ロケーション">
64
+
65
+ <div>
66
+
67
+ <select name="部屋" id="">
68
+
69
+ <option value="">まるまる貸し切り</option>
70
+
71
+ <option value="">個室</option>
72
+
73
+ <option value="">シェアルーム</option>
74
+
75
+ </select>
76
+
77
+ <select name="人数" id="">
78
+
79
+ <option value="">ゲスト1人</option>
80
+
81
+ <option value="">ゲスト2人</option>
82
+
83
+ <option value="">ゲスト3人</option>
84
+
85
+ <option selected=slected value="">ゲスト4人</option>
86
+
87
+ <option value="">ゲスト5人</option>
88
+
89
+ <option value="">ゲスト6人</option>
90
+
91
+ <option value="">ゲスト7人</option>
92
+
93
+ <option value="">ゲスト8人</option>
94
+
95
+ <option value="">ゲスト9人</option>
96
+
97
+ <option value="">ゲスト10人</option>
98
+
99
+ <option value="">ゲスト11人</option>
100
+
101
+ <option value="">ゲスト12人</option>
102
+
103
+ </select>
104
+
105
+ </div>
106
+
107
+ <button type="button">はじめる</button>
108
+
109
+ </div>
110
+
111
+ </section>
112
+
113
+ </main>
114
+
115
+ </body>
116
+
117
+ </html>
118
+
119
+ ```
120
+
121
+ ```css
122
+
123
+ body{
124
+
125
+ margin: 0;
126
+
127
+ }
128
+
129
+ header{
130
+
131
+ width: 100%;
132
+
133
+ height: 81px;
134
+
135
+ background-color: white;
136
+
137
+ display: flex;
138
+
139
+ z-index: 1;
140
+
141
+ position: fixed;
142
+
143
+ justify-content: space-between;
144
+
145
+ align-items: center;
146
+
147
+ .header-ctn-left{
148
+
149
+ margin-left: 20px;
150
+
151
+ >*{
152
+
153
+ color: #484848;
154
+
155
+ margin-right: 20px;
156
+
157
+ text-decoration: none;
158
+
159
+ }
160
+
161
+ a{
162
+
163
+ &:hover{
164
+
165
+ border-bottom: solid 1px #484848;;
166
+
167
+ }
168
+
169
+ }
170
+
171
+ img{
172
+
173
+ width: 37px;
174
+
175
+ vertical-align: middle;
176
+
177
+ }
178
+
179
+ }
180
+
181
+ button{
182
+
183
+ width: 91px;
184
+
185
+ font-weight: bold;
186
+
187
+ height: 37px;
188
+
189
+ margin-right: 43px;
190
+
191
+ background-color: #DB3742;
192
+
193
+ border: none;
194
+
195
+ border-radius: 5px;
196
+
197
+ color: white;
198
+
199
+ }
200
+
201
+ }
202
+
203
+ main{
204
+
205
+ .eyecatch{
206
+
207
+ background-image: url(../img/eyecatch.jpg);
208
+
209
+ height: 600px;
210
+
211
+ background-size: cover;
212
+
213
+ background-repeat: no-repeat;
214
+
215
+ background-position: center top;
216
+
217
+ position: relative;
218
+
219
+ .eyecatch-ctn{
220
+
221
+ position: absolute;
222
+
223
+ right:20px;
224
+
225
+ top: 50%;
226
+
227
+ transform: translate(0,-50%);
228
+
229
+ background-color: white;
230
+
231
+ height: 423px;
232
+
233
+ width: 460px;
234
+
235
+ p:nth-of-type(1){
236
+
237
+ font-size: 40px;
238
+
239
+ font-weight: 800;
240
+
241
+ margin: 0 32px;
242
+
243
+ line-height: 40px;
244
+
245
+ }
246
+
247
+ p{
248
+
249
+ font-size: 16px;
250
+
251
+ font-weight: bold;
252
+
253
+ }
254
+
255
+ input{
256
+
257
+ height: 38px;
258
+
259
+ width: 100%;
260
+
261
+ box-sizing: border-box;
262
+
263
+ }
264
+
265
+ select:nth-of-type(1){
266
+
267
+ box-sizing: border-box;
268
+
269
+ height: 38px;
270
+
271
+ width: 50%;
272
+
273
+ }
274
+
275
+ select:nth-of-type(2){
276
+
277
+ box-sizing: border-box;
278
+
279
+ height: 38px;
280
+
281
+ width: 40%;
282
+
283
+ }
284
+
285
+ }
286
+
287
+ }
288
+
289
+ }
290
+
291
+ ```