teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

『コードの挿入』を使い、コード部分の表記を変えました。

2020/08/13 14:49

投稿

wankoromochi
wankoromochi

スコア2

title CHANGED
File without changes
body CHANGED
@@ -26,10 +26,8 @@
26
26
 
27
27
  ### 該当のソースコード
28
28
 
29
- HTML CSS
30
-
31
- HTML
29
+ ```HTML
32
- <div class="main">
30
+ <div class="main">
33
31
  <div class="copy-container">
34
32
  <h1>HELLO WORLD<span>.</span></h1>
35
33
  <h2>プログラミングの世界へようこそ</h2>
@@ -58,8 +56,8 @@
58
56
  </body>
59
57
  </html>
60
58
 
61
- ---
59
+ ```
62
- CSS
60
+ ```CSS
63
61
 
64
62
  /* CSSのリセット(消さないでください) */
65
63
  html, body,
@@ -137,11 +135,312 @@
137
135
  font-size: 24px;
138
136
  margin-top: 30px;
139
137
  }
138
+ ```
140
139
 
140
+
141
141
  ### 試したこと
142
142
 
143
143
  ここに問題に対して試したことを記載してください。
144
144
 
145
145
  ### 補足情報(FW/ツールのバージョンなど)
146
146
 
147
+ ここにより詳細な情報を記載してください。
148
+
149
+ ### 前提・実現したいこと
150
+
151
+ ここに質問の内容を詳しく書いてください。
152
+
153
+ ![イメージ説明](d590b16c231ac34ac986c8002f938871.png)
154
+ ウェブサイトの真ん中部分 html の <div class="contents">以下、学べるレッスン以下の箇所の質問です。
155
+ 1.
156
+ 答えの方のCSS の contens には、margin-top:100px がありますが、
157
+ それを自分でCSSに書くと、配置バランスが大きく下がります。
158
+ 100px分下がるようです。
159
+ 同じく、答えの方のCSSの.contensには、margin-left:80; がなくても、左から 80px分あきます。
160
+ ![イメージ説明](7124b71eb414fc483652eea0d4acaf05.png)
161
+
162
+
163
+ 2.
164
+ 答えの方の cotents には、margin-bottom:100 を記述しなくても、
165
+ <p>HTML&CSS等の4つのp要素の下のスペース(margin)が詰まりません。
166
+ ![イメージ説明](e5013b3e8dd3ef89f47d2b2b0e8b1407.png)
167
+
168
+ 3.
169
+ 自分のコードだと、margin-left:80; や margin-bottom:100;を記述しないと、見本(仕様書)と同じになりません。
170
+ なぜでしょうか?
171
+
172
+ ```
173
+ エラーメッセージ
174
+ ```
175
+
176
+ ### 該当のソースコード
177
+ ```HTML
178
+ <div class="main">
179
+ <div class="copy-container">
180
+ <h1>HELLO WORLD<span>.</span></h1>
181
+ <h2>プログラミングの世界へようこそ</h2>
182
+ </div>
183
+
184
+ <div class="contents">
185
+ <h3 class="section-title">学べるレッスン</h3>
186
+ <div class="contents-item">
187
+ <img src="https://s3-ap-northeast-1.amazonaws.com/progate/shared/images/lesson/html/study/html.svg">
188
+ <p>HTML & CSS</p>
189
+ </div>
190
+ <div class="contents-item">
191
+ <img src="https://s3-ap-northeast-1.amazonaws.com/progate/shared/images/lesson/html/study/php.svg">
192
+ <p>PHP</p>
193
+ </div>
194
+ <div class="contents-item">
195
+ <img src="https://s3-ap-northeast-1.amazonaws.com/progate/shared/images/lesson/html/study/ruby.svg">
196
+ <p>Ruby</p>
197
+ </div>
198
+ <div class="contents-item">
199
+ <img src="https://s3-ap-northeast-1.amazonaws.com/progate/shared/images/lesson/html/study/swift.svg">
200
+ <p>Swift</p>
201
+ </div>
202
+ </div>
203
+ </div>
204
+ </body>
205
+ </html>
206
+
207
+ ```
208
+
209
+ ```CSS
210
+ /* CSSのリセット(消さないでください) */
211
+ html, body,
212
+ ul, ol, li,
213
+ h1, h2, h3, h4, h5, h6, p,
214
+ form, input, div {
215
+ margin: 0;
216
+ padding: 0;
217
+ }
218
+
219
+ body {
220
+ font-family: "Avenir Next", "Hiragino Kaku Gothic ProN W3", sans-serif;
221
+ }
222
+
223
+ li {
224
+ list-style: none;
225
+ }
226
+
227
+ /* ここからCSSを記述してください */
228
+ .header {
229
+ background-color: #26d0c9;
230
+ color: #fff;
231
+ height: 90px;
232
+ }
233
+
234
+ .header-logo {
235
+ float: left;
236
+ font-size: 36px;
237
+ padding: 20px 40px;
238
+ }
239
+
240
+ .header-list {
241
+ float: left;
242
+ }
243
+
244
+ .header-list li {
245
+ float: left;
246
+ padding: 33px 20px;
247
+ }
248
+
249
+ .main {
250
+ padding: 100px 80px;
251
+ }
252
+
253
+ .copy-container h1 {
254
+ font-size: 140px;
255
+ }
256
+
257
+ .copy-container h2 {
258
+ font-size: 60px;
259
+ }
260
+
261
+ .copy-container span {
262
+ color: #ff4a4a;
263
+ }
264
+
265
+ .contents {
266
+ height: 500px;
267
+ margin-top: 100px;
268
+ }
269
+
270
+ .section-title {
271
+ border-bottom: 2px solid #dee7ec;
272
+ font-size: 28px;
273
+ padding-bottom: 15px;
274
+ margin-bottom: 50px;
275
+ }
276
+
277
+ .contents-item {
278
+ float: left;
279
+ margin-right: 40px;
280
+ }
281
+
282
+ .contents-item p {
283
+ font-size: 24px;
284
+ margin-top: 30px;
285
+ }
286
+ ```
287
+
288
+
289
+ ### 試したこと
290
+
291
+ .contents {}内に、margin-top:100; margin-left: 80; を書いたり消したりした。
292
+ .contens-item{}内に、margin-bottom:100; を書いたり消したりした。
293
+
294
+ ### 補足情報(FW/ツールのバージョンなど)
295
+
296
+ ここにより詳細な情報を記載してください。
297
+
298
+
299
+ ### 前提・実現したいこと
300
+
301
+ ここに質問の内容を詳しく書いてください。
302
+
303
+ ![イメージ説明](d590b16c231ac34ac986c8002f938871.png)
304
+ ウェブサイトの真ん中部分 html の <div class="contents">以下、学べるレッスン以下の箇所の質問です。
305
+ 1.
306
+ 答えの方のCSS の contens には、margin-top:100px がありますが、
307
+ それを自分でCSSに書くと、配置バランスが大きく下がります。
308
+ 100px分下がるようです。
309
+ 同じく、答えの方のCSSの.contensには、margin-left:80; がなくても、左から 80px分あきます。
310
+ ![イメージ説明](7124b71eb414fc483652eea0d4acaf05.png)
311
+
312
+
313
+ 2.
314
+ 答えの方の cotents には、margin-bottom:100 を記述しなくても、
315
+ <p>HTML&CSS等の4つのp要素の下のスペース(margin)が詰まりません。
316
+ ![イメージ説明](e5013b3e8dd3ef89f47d2b2b0e8b1407.png)
317
+
318
+ 3.
319
+ 自分のコードだと、margin-left:80; や margin-bottom:100;を記述しないと、見本(仕様書)と同じになりません。
320
+ なぜでしょうか?
321
+
322
+ ```
323
+ エラーメッセージ
324
+ ```
325
+
326
+ ### 該当のソースコード
327
+ ```HTML
328
+ <div class="main">
329
+ <div class="copy-container">
330
+ <h1>HELLO WORLD<span>.</span></h1>
331
+ <h2>プログラミングの世界へようこそ</h2>
332
+ </div>
333
+
334
+ <div class="contents">
335
+ <h3 class="section-title">学べるレッスン</h3>
336
+ <div class="contents-item">
337
+ <img src="https://s3-ap-northeast-1.amazonaws.com/progate/shared/images/lesson/html/study/html.svg">
338
+ <p>HTML & CSS</p>
339
+ </div>
340
+ <div class="contents-item">
341
+ <img src="https://s3-ap-northeast-1.amazonaws.com/progate/shared/images/lesson/html/study/php.svg">
342
+ <p>PHP</p>
343
+ </div>
344
+ <div class="contents-item">
345
+ <img src="https://s3-ap-northeast-1.amazonaws.com/progate/shared/images/lesson/html/study/ruby.svg">
346
+ <p>Ruby</p>
347
+ </div>
348
+ <div class="contents-item">
349
+ <img src="https://s3-ap-northeast-1.amazonaws.com/progate/shared/images/lesson/html/study/swift.svg">
350
+ <p>Swift</p>
351
+ </div>
352
+ </div>
353
+ </div>
354
+ </body>
355
+ </html>
356
+
357
+ ```
358
+
359
+ ```CSS
360
+ /* CSSのリセット(消さないでください) */
361
+ html, body,
362
+ ul, ol, li,
363
+ h1, h2, h3, h4, h5, h6, p,
364
+ form, input, div {
365
+ margin: 0;
366
+ padding: 0;
367
+ }
368
+
369
+ body {
370
+ font-family: "Avenir Next", "Hiragino Kaku Gothic ProN W3", sans-serif;
371
+ }
372
+
373
+ li {
374
+ list-style: none;
375
+ }
376
+
377
+ /* ここからCSSを記述してください */
378
+ .header {
379
+ background-color: #26d0c9;
380
+ color: #fff;
381
+ height: 90px;
382
+ }
383
+
384
+ .header-logo {
385
+ float: left;
386
+ font-size: 36px;
387
+ padding: 20px 40px;
388
+ }
389
+
390
+ .header-list {
391
+ float: left;
392
+ }
393
+
394
+ .header-list li {
395
+ float: left;
396
+ padding: 33px 20px;
397
+ }
398
+
399
+ .main {
400
+ padding: 100px 80px;
401
+ }
402
+
403
+ .copy-container h1 {
404
+ font-size: 140px;
405
+ }
406
+
407
+ .copy-container h2 {
408
+ font-size: 60px;
409
+ }
410
+
411
+ .copy-container span {
412
+ color: #ff4a4a;
413
+ }
414
+
415
+ .contents {
416
+ height: 500px;
417
+ margin-top: 100px;
418
+ }
419
+
420
+ .section-title {
421
+ border-bottom: 2px solid #dee7ec;
422
+ font-size: 28px;
423
+ padding-bottom: 15px;
424
+ margin-bottom: 50px;
425
+ }
426
+
427
+ .contents-item {
428
+ float: left;
429
+ margin-right: 40px;
430
+ }
431
+
432
+ .contents-item p {
433
+ font-size: 24px;
434
+ margin-top: 30px;
435
+ }
436
+ ```
437
+
438
+
439
+ ### 試したこと
440
+ CSSの→
441
+  .contents {}内に、margin-top:100; margin-left: 80; を書いたり消したりした。
442
+  .contens-item{}内に、margin-bottom:100; を書いたり消したりした。
443
+
444
+ ### 補足情報(FW/ツールのバージョンなど)
445
+
147
446
  ここにより詳細な情報を記載してください。