質問編集履歴

3

説明不足だったため

2020/02/12 15:25

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -1,6 +1,6 @@
1
1
  ```html
2
2
 
3
- <!DOCTYPE html>
3
+ <!DOCTYPE html>-
4
4
 
5
5
  <html>
6
6
 
@@ -457,3 +457,53 @@
457
457
 
458
458
 
459
459
  ```
460
+
461
+ ### 前提・実現したいこと
462
+
463
+
464
+
465
+ ここに質問の内容を詳しく書いてください。
466
+
467
+ (例)PHP(CakePHP)で●●なシステムを作っています。
468
+
469
+ ■■な機能を実装中に以下のエラーメッセージが発生しました。
470
+
471
+
472
+
473
+ ### 発生している問題・エラーメッセージ
474
+
475
+
476
+
477
+ ```
478
+
479
+ lesson-icon pもtxt-contentsも同じブロック要素なのにlesson-icon pはブロック要素のままwidthが適用され、txt-contentsはdisplay:inline-block;にしないとwidthが適用されないのか分からないので質問させていただきました。
480
+
481
+ ```
482
+
483
+
484
+
485
+ ### 該当のソースコード
486
+
487
+
488
+
489
+ ```ここに言語名を入力
490
+
491
+ ソースコード
492
+
493
+ ```
494
+
495
+
496
+
497
+ ### 試したこと
498
+
499
+
500
+
501
+ ここに問題に対して試したことを記載してください。
502
+
503
+
504
+
505
+ ### 補足情報(FW/ツールのバージョンなど)
506
+
507
+
508
+
509
+ ここにより詳細な情報を記載してください。

2

誤字のため

2020/02/12 15:25

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -448,7 +448,7 @@
448
448
 
449
449
  margin-top: 20px;
450
450
 
451
- display:inline-bloc;
451
+ display:inline-block;
452
452
 
453
453
  width:80%;
454
454
 

1

回答者にお願いされたため。

2020/02/12 15:09

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -1 +1,459 @@
1
- なぜ、lesson-icon pもtxt-contentsも同じ<p>のblock要素なのにlesson-icon pは、display:inline-block;にしなくてもwidthが適用されて、txt-contentsにはdisplay:inline-block;がないとwidthが適用されないのですか?![イメージ説明](d65a2f2b4121db42ab6c17e4038d6817.png)
1
+ ```html
2
+
3
+ <!DOCTYPE html>
4
+
5
+ <html>
6
+
7
+ <head>
8
+
9
+ <meta charset="utf-8">
10
+
11
+ <title>Progate</title>
12
+
13
+ <link rel="stylesheet" href="stylesheet.css">
14
+
15
+ <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
16
+
17
+ </head>
18
+
19
+ <body>
20
+
21
+ <header>
22
+
23
+ <div class="container">
24
+
25
+ <div class="header-left">
26
+
27
+ <img class="logo" src="https://prog-8.com/images/html/advanced/main_logo.png">
28
+
29
+ </div>
30
+
31
+ <div class="header-right">
32
+
33
+ <a href="#" class="login">ログイン</a>
34
+
35
+ </div>
36
+
37
+ </div>
38
+
39
+ </header>
40
+
41
+ <div class="top-wrapper">
42
+
43
+ <div class="container">
44
+
45
+ <h1>LEARN TO CODE.</h1>
46
+
47
+ <h1>LEARN TO BE CREATIVE.</h1>
48
+
49
+ <p>Progateはオンラインプログラミング学習サービスです。</p>
50
+
51
+ <p>初心者にもやさしいスライドとレッスンで、Webサービスを作りながらプログラミングを学んでいきましょう。</p>
52
+
53
+ <div class="btn-wrapper">
54
+
55
+ <a href="#" class="btn signup">新規登録はこちら</a>
56
+
57
+ <p>or sign up with</p>
58
+
59
+ <a href="#" class="btn facebook"><span class="fa fa-facebook"></span>Facebookで登録</a>
60
+
61
+ <a href="#" class="btn twitter"><span class="fa fa-twitter"></span>Twitterで登録</a>
62
+
63
+ </div>
64
+
65
+ </div>
66
+
67
+ </div>
68
+
69
+ <div class="lesson-wrapper">
70
+
71
+ <div class="container">
72
+
73
+ <div class="heading">
74
+
75
+ <h2>Learn Where to Get Started!</h2>
76
+
77
+ </div>
78
+
79
+ <div class="lessons">
80
+
81
+ <div class="lesson">
82
+
83
+ <div class="lesson-icon">
84
+
85
+ <img src="https://prog-8.com/images/html/advanced/html.png">
86
+
87
+ <p>HTML & CSS</p>
88
+
89
+ </div>
90
+
91
+ <p class="txt-contents">Webページの作成に使用される言語です。HTMLとCSSを組み合わせることで、静的なページを作り上げることができます。</p>
92
+
93
+ </div>
94
+
95
+ <div class="lesson">
96
+
97
+ <div class="lesson-icon">
98
+
99
+ <img src="https://prog-8.com/images/html/advanced/jQuery.png">
100
+
101
+ <p>jQuery</p>
102
+
103
+ </div>
104
+
105
+ <p class="txt-contents">素敵な動きを手軽に実装できるJavaScriptライブラリです。 アニメーション効果をつけたり、Ajax(エイジャックス)を使って外部ファイルを読み込んだりと色々なことができます。</p>
106
+
107
+ </div>
108
+
109
+ <div class="lesson">
110
+
111
+ <div class="lesson-icon">
112
+
113
+ <img src="https://prog-8.com/images/html/advanced/ruby.png">
114
+
115
+ <p>Ruby</p>
116
+
117
+ </div>
118
+
119
+ <p class="txt-contents">オープンソースの動的なプログラミング言語で、 シンプルさと高い生産性を備えています。大きなWebアプリケーションから小さな日用ツールまで、さまざまなソフトウェアを作ることができます。</p>
120
+
121
+ </div>
122
+
123
+ <div class="lesson">
124
+
125
+ <div class="lesson-icon">
126
+
127
+ <img src="https://prog-8.com/images/html/advanced/php.png">
128
+
129
+ <p>PHP</p>
130
+
131
+ </div>
132
+
133
+ <p class="txt-contents">HTMLだけではページの内容を変えることはできません。PHPはHTMLにプログラムを埋め込み、それを可能にします。</p>
134
+
135
+ </div>
136
+
137
+ </div>
138
+
139
+ </div>
140
+
141
+ </div>
142
+
143
+ <div class="message-wrapper">
144
+
145
+ </div>
146
+
147
+ <footer>
148
+
149
+ </footer>
150
+
151
+ </body>
152
+
153
+ </html>
154
+
155
+
156
+
157
+ ```
158
+
159
+ ```css
160
+
161
+ body {
162
+
163
+ margin: 0;
164
+
165
+ font-family: "Hiragino Kaku Gothic ProN";
166
+
167
+ }
168
+
169
+
170
+
171
+ a {
172
+
173
+ text-decoration: none;
174
+
175
+ }
176
+
177
+
178
+
179
+ .container {
180
+
181
+ width: 1170px;
182
+
183
+ padding: 0 15px;
184
+
185
+ margin: 0 auto;
186
+
187
+ }
188
+
189
+
190
+
191
+ .top-wrapper {
192
+
193
+ padding: 180px 0 100px 0;
194
+
195
+ background-image: url(https://prog-8.com/images/html/advanced/top.png);
196
+
197
+ background-size: cover;
198
+
199
+ color: white;
200
+
201
+ text-align: center;
202
+
203
+ }
204
+
205
+
206
+
207
+ .top-wrapper h1 {
208
+
209
+ opacity: 0.7;
210
+
211
+ font-size: 45px;
212
+
213
+ letter-spacing: 5px;
214
+
215
+ }
216
+
217
+
218
+
219
+ .top-wrapper p {
220
+
221
+ opacity: 0.7;
222
+
223
+ }
224
+
225
+
226
+
227
+ .btn-wrapper {
228
+
229
+ margin: 20px 0;
230
+
231
+ }
232
+
233
+
234
+
235
+ .btn-wrapper p {
236
+
237
+ margin: 10px 0;
238
+
239
+ }
240
+
241
+
242
+
243
+ .signup {
244
+
245
+ background-color: #239b76;
246
+
247
+ }
248
+
249
+
250
+
251
+ .facebook {
252
+
253
+ background-color: #3b5998;
254
+
255
+ margin-right: 10px;
256
+
257
+ }
258
+
259
+
260
+
261
+ .twitter {
262
+
263
+ background-color: #55acee;
264
+
265
+ }
266
+
267
+
268
+
269
+ .btn {
270
+
271
+ padding: 8px 24px;
272
+
273
+ color: white;
274
+
275
+ display: inline-block;
276
+
277
+ opacity: 0.8;
278
+
279
+ border-radius: 4px;
280
+
281
+ }
282
+
283
+
284
+
285
+ .btn:hover {
286
+
287
+ opacity: 1;
288
+
289
+ }
290
+
291
+
292
+
293
+ .fa {
294
+
295
+ margin-right: 5px;
296
+
297
+ }
298
+
299
+
300
+
301
+ header {
302
+
303
+ height: 65px;
304
+
305
+ width: 100%;
306
+
307
+ background-color: rgba(34, 49, 52, 0.9);
308
+
309
+ }
310
+
311
+
312
+
313
+ .logo {
314
+
315
+ width: 124px;
316
+
317
+ margin-top: 20px;
318
+
319
+ }
320
+
321
+
322
+
323
+ .header-left {
324
+
325
+ float: left;
326
+
327
+ }
328
+
329
+
330
+
331
+ .header-right {
332
+
333
+ float: right;
334
+
335
+ background-color: rgba(255, 255, 255, 0.3);
336
+
337
+ transition: all 0.5s;
338
+
339
+ }
340
+
341
+
342
+
343
+ .header-right:hover {
344
+
345
+ background-color: rgba(255, 255, 255, 0.5);
346
+
347
+ }
348
+
349
+
350
+
351
+ .header-right a {
352
+
353
+ line-height: 65px;
354
+
355
+ padding: 0 25px;
356
+
357
+ color: white;
358
+
359
+ display: block;
360
+
361
+ }
362
+
363
+
364
+
365
+ .lesson-wrapper {
366
+
367
+ height: 500px;
368
+
369
+ padding-bottom: 80px;
370
+
371
+ background-color: #f7f7f7;
372
+
373
+ /* text-alignをcenterに指定してください */
374
+
375
+ text-align:center;
376
+
377
+ }
378
+
379
+
380
+
381
+ .heading {
382
+
383
+ padding-top: 60px;
384
+
385
+ padding-bottom: 30px;
386
+
387
+ color: #5f5d60;
388
+
389
+ }
390
+
391
+
392
+
393
+ .heading h2 {
394
+
395
+ font-weight: normal;
396
+
397
+ }
398
+
399
+
400
+
401
+ .lesson {
402
+
403
+ float: left;
404
+
405
+ width: 25%;
406
+
407
+ }
408
+
409
+
410
+
411
+ /* lesson-iconクラスのCSSを指定してください */
412
+
413
+ .lesson-icon{
414
+
415
+ position:relative;
416
+
417
+ }
418
+
419
+
420
+
421
+
422
+
423
+ /* lesson-iconの中の<p>のCSSを指定してください */
424
+
425
+ .lesson-icon p{
426
+
427
+ position:absolute;
428
+
429
+ top:90px;
430
+
431
+ width:100%;
432
+
433
+ color:#fff;
434
+
435
+ }
436
+
437
+
438
+
439
+
440
+
441
+ /* txt-contentsクラスのCSSを指定してください */
442
+
443
+ .txt-contents{
444
+
445
+ font-size:12px;
446
+
447
+ color:#b3aeb5;
448
+
449
+ margin-top: 20px;
450
+
451
+ display:inline-bloc;
452
+
453
+ width:80%;
454
+
455
+ }
456
+
457
+
458
+
459
+ ```