質問編集履歴

1

文法の追加

2018/12/21 16:33

投稿

leaf.
leaf.

スコア16

test CHANGED
File without changes
test CHANGED
@@ -18,6 +18,480 @@
18
18
 
19
19
  [JFiddle](https://jsfiddle.net/h3wr8f04/3/)
20
20
 
21
+ ```html
22
+
23
+ <!DOCTYPE html>
24
+
25
+ <html lang="ja">
26
+
27
+ <head>
28
+
29
+ <meta charset="utf-8">
30
+
31
+ <meta name="viewport" content="width=device-width,initial-scale=1.0,minium-scale=1.0,user-scalable=no">
32
+
33
+ <meta name="description" content="abc">
34
+
35
+ <title>aaa</title>
36
+
37
+ <link rel="stylesheet" href="css/index.css">
38
+
39
+ <link href="https://fonts.googleapis.com/css?family=Viga" rel="stylesheet">
40
+
41
+ <link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet">
42
+
43
+ <link href="https://fonts.googleapis.com/css?family=B612" rel="stylesheet">
44
+
45
+ </head>
46
+
47
+ <body>
48
+
49
+ <!--ヘッダー-->
50
+
51
+ <header>
52
+
53
+ <p>
54
+
55
+ <a href="index.html">aaa</a>
56
+
57
+ </p>
58
+
59
+ </header>
60
+
61
+
62
+
63
+ <!--記事-->
64
+
65
+ <div>
66
+
67
+ <div class="main">
68
+
69
+ <ul class="container">
70
+
71
+ <li>
72
+
73
+ <img src="img/aaa.png">
74
+
75
+ <time datetime="2018-12-21">2018年12月21日</time>
76
+
77
+ <dl>
78
+
79
+ <dt>説明</dt>
80
+
81
+ </dl>
82
+
83
+ </li>
84
+
85
+ <li>
86
+
87
+ <img src="img/aaa.png">
88
+
89
+ <time datetime="2018-12-21">2018年12月21日</time>
90
+
91
+ <dl>
92
+
93
+ <dt>説明</dt>
94
+
95
+ </dl>
96
+
97
+ </li>
98
+
99
+ <li>
100
+
101
+ <img src="img/aaa.png">
102
+
103
+ <time datetime="2018-12-21">2018年12月21日</time>
104
+
105
+ <dl>
106
+
107
+ <dt>説明</dt>
108
+
109
+ </dl>
110
+
111
+ </li>
112
+
113
+ <li>
114
+
115
+ <img src="img/aaa.png">
116
+
117
+ <time datetime="2018-12-21">2018年12月21日</time>
118
+
119
+ <dl>
120
+
121
+ <dt>説明</dt>
122
+
123
+ </dl>
124
+
125
+ </li>
126
+
127
+ <li>
128
+
129
+ <img src="img/aaa.png">
130
+
131
+ <time datetime="2018-12-21">2018年12月21日</time>
132
+
133
+ <dl>
134
+
135
+ <dt>説明</dt>
136
+
137
+ </dl>
138
+
139
+ </li>
140
+
141
+ </ul>
142
+
143
+ </div>
144
+
145
+
146
+
147
+ <div class="side">
148
+
149
+ <div>
150
+
151
+ <h3>CATEGORY</h3>
152
+
153
+ <ul>
154
+
155
+ <li><a href="#">games</a></li>
156
+
157
+ <li><a href="#">foods</a></li>
158
+
159
+ <li><a href="#">gadgets</a></li>
160
+
161
+ </ul>
162
+
163
+ </div>
164
+
165
+ </div>
166
+
167
+ </div>
168
+
169
+ <!--記事-->
170
+
171
+ </body>
172
+
173
+ </html>
174
+
175
+ ```
176
+
177
+ ```css
178
+
179
+ /*PC*/
180
+
181
+ body{
182
+
183
+ margin: 0;
184
+
185
+ padding: 0;
186
+
187
+ background: rgb(234, 237, 242);
188
+
189
+ }
190
+
191
+ /*ヘッダー*/
192
+
193
+ header{
194
+
195
+ background: skyblue;
196
+
197
+ width: 100%;
198
+
199
+ height: 50px;
200
+
201
+ display: flex;
202
+
203
+ align-items: center;
204
+
205
+ justify-content: center;
206
+
207
+ }
208
+
209
+ header p a{
210
+
211
+ text-decoration: none;
212
+
213
+ color: white;
214
+
215
+ font-size: 190%;
216
+
217
+ font-family: 'Viga', sans-serif;
218
+
219
+ }
220
+
221
+ /*最新記事*/
222
+
223
+ .container{
224
+
225
+ display: flex;
226
+
227
+ list-style: none;
228
+
229
+ padding: 0;
230
+
231
+ margin: 0 auto;
232
+
233
+ padding: 0;
234
+
235
+ flex-wrap: wrap;
236
+
237
+ justify-content: center;
238
+
239
+ width: auto;
240
+
241
+ }
242
+
243
+ .container img{
244
+
245
+ width: 100%;
246
+
247
+ height: auto;
248
+
249
+ border-top-left-radius: 10px;
250
+
251
+ border-top-right-radius: 10px;
252
+
253
+ }
254
+
255
+ .container li{
256
+
257
+ width: 15%;
258
+
259
+ margin: 1%;
260
+
261
+ box-sizing: border-box;
262
+
263
+ padding: 1px;
264
+
265
+ background: white;
266
+
267
+ border-radius: 10px;
268
+
269
+ opacity: 1;
270
+
271
+ transition: opacity 1s;
272
+
273
+ }
274
+
275
+ .container li:hover{
276
+
277
+ opacity: 0.5;
278
+
279
+ }
280
+
281
+ .container li time{
282
+
283
+ color: #666;
284
+
285
+ font-size: 13px;
286
+
287
+ }
288
+
289
+ /*float*/
290
+
291
+ .main{
292
+
293
+ float: left;
294
+
295
+ }
296
+
297
+ .side{
298
+
299
+ float: right;
300
+
301
+ background: white;
302
+
303
+ width: 300px;
304
+
305
+ height: 200px;
306
+
307
+ position: relative;
308
+
309
+ right: 50px;
310
+
311
+ bottom: 150px;
312
+
313
+ }
314
+
315
+ .side ul li{
316
+
317
+ list-style: none;
318
+
319
+ }
320
+
321
+ .side ul li a{
322
+
323
+ text-decoration: none;
324
+
325
+ color: #333;
326
+
327
+ }
328
+
329
+ .side h3{
330
+
331
+ background-color: skyblue;
332
+
333
+ margin: 0;
334
+
335
+ padding: 20px;
336
+
337
+ color: white;
338
+
339
+ }
340
+
341
+ /*レスポンシブ*/
342
+
343
+ @media screen and (min-width:0px) and (max-width:480px) {
344
+
345
+ header{
346
+
347
+ background: skyblue;
348
+
349
+ width: 100%;
350
+
351
+ height: 100px;
352
+
353
+ display: flex;
354
+
355
+ align-items: center;
356
+
357
+ justify-content: center;
358
+
359
+ }
360
+
361
+ .container li{
362
+
363
+ width: 80%;
364
+
365
+ margin: 1%;
366
+
367
+ box-sizing: border-box;
368
+
369
+ padding: 1px;
370
+
371
+ background: white;
372
+
373
+ border-radius: 10px;
374
+
375
+ opacity: 1;
376
+
377
+ transition: opacity 1s;
378
+
379
+ }
380
+
381
+ .container li dl dt{
382
+
383
+ font-size: 90%;
384
+
385
+ }
386
+
387
+
388
+
389
+ }
390
+
391
+
392
+
393
+ @media screen and (min-width:750px) and (max-width:1000px){
394
+
395
+ header{
396
+
397
+ background: skyblue;
398
+
399
+ width: 100%;
400
+
401
+ height: 150px;
402
+
403
+ display: flex;
404
+
405
+ align-items: center;
406
+
407
+ justify-content: center;
408
+
409
+ }
410
+
411
+ .container li{
412
+
413
+ width: 40%;
414
+
415
+ margin: 1%;
416
+
417
+ box-sizing: border-box;
418
+
419
+ padding: 1px;
420
+
421
+ background: white;
422
+
423
+ border-radius: 10px;
424
+
425
+ opacity: 1;
426
+
427
+ transition: opacity 1s;
428
+
429
+ }
430
+
431
+ .container li dl dt{
432
+
433
+ font-size: 140%;
434
+
435
+ }
436
+
437
+ }
438
+
439
+ @media screen and (min-width:1001px) and (max-width:1024px){
440
+
441
+ header{
442
+
443
+ background: skyblue;
444
+
445
+ width: 100%;
446
+
447
+ height: 150px;
448
+
449
+ display: flex;
450
+
451
+ align-items: center;
452
+
453
+ justify-content: center;
454
+
455
+ }
456
+
457
+ header p a{
458
+
459
+ font-size: 300%;
460
+
461
+ }
462
+
463
+ .container li{
464
+
465
+ width: 40%;
466
+
467
+ margin: 1%;
468
+
469
+ box-sizing: border-box;
470
+
471
+ padding: 1px;
472
+
473
+ background: white;
474
+
475
+ border-radius: 10px;
476
+
477
+ opacity: 1;
478
+
479
+ transition: opacity 1s;
480
+
481
+ }
482
+
483
+ .container li dt{
484
+
485
+ font-size: 30px;
486
+
487
+ }
488
+
489
+ }
490
+
491
+
492
+
493
+ ```
494
+
21
495
  ##やったこと-失敗したこと
22
496
 
23
497
  ``float: rightとleft`` を使ってみたところ、PC用は正常にできたが、スマホ用は下にきたものの中央揃え出来ていなかった。