質問編集履歴

1

記載したstyle.cssに沿って反映していないindex.htmlと反映しているabout.htmlの内容を載せました。

2018/06/10 16:20

投稿

chashubutabuta
chashubutabuta

スコア11

test CHANGED
File without changes
test CHANGED
@@ -12,7 +12,359 @@
12
12
 
13
13
  現在ボックススタイルについて下記の通りに入力したのですが変化が見られません。
14
14
 
15
+ 以下、index.html(反映されていないHTML、)
16
+
15
- ```
17
+ ```
18
+
19
+ <!DOCTYPE html>
20
+
21
+ <html lang="ja">
22
+
23
+ <head>
24
+
25
+ <meta charset="utf-8">
26
+
27
+ <link href="css/style.css" rel="stylesheet">
28
+
29
+ <meta name="keywords" content="fruvege,オススメの果物をご紹介">
30
+
31
+ <meta name="description" content="フルーツ農園へ">
32
+
33
+ <title>
34
+
35
+ フルーツのススメ
36
+
37
+ </title>
38
+
39
+ </head>
40
+
41
+ <!--headここまで-->
42
+
43
+ <body>
44
+
45
+ <header>
46
+
47
+ <div class="header box">
48
+
49
+ <h1><a href="index.html"><img src="images/logo_header.png" alt="fruvegeロゴ" width="240" height="55"></a></h1>
50
+
51
+ <nav>
52
+
53
+ <ul>
54
+
55
+ <li><a href="index.html">ホーム</a></li>
56
+
57
+ <li><a href="fruit.html">フルーツ</a></li>
58
+
59
+ <li><a href="vegetable.html">ベジタブル</a></li>
60
+
61
+ <li><a href="about.html">fruvegeとは</a></li>
62
+
63
+ </ul>
64
+
65
+ </nav>
66
+
67
+ <!--navここまで-->
68
+
69
+ </div>
70
+
71
+ </header>
72
+
73
+ <!--ヘッダーここまで-->
74
+
75
+ <main>
76
+
77
+ <img src="images/key_v.png" alt="width=1024" height="480">
78
+
79
+ <h2>Welcom!! fruvege</h2>
80
+
81
+
82
+
83
+ <p>フルーツと野菜のほんとうのおいしさを<br>
84
+
85
+ みなさまにお届けする”fruvege”です。<br>
86
+
87
+ <strong>自然の恵みを生かした生産方法</strong>で育てたフルーツとベジタブルを<br>
88
+
89
+ みなさまにご提供いたします。</p>
90
+
91
+ <div class="main box">
92
+
93
+ </div>
94
+
95
+ </main>
96
+
97
+ <!--メインここまで-->
98
+
99
+ <footer>
100
+
101
+ <div class="footer box">
102
+
103
+ <p><img src="images/logo_footer.png" alt="fruvegeロゴ" width="141" height="39"></p>
104
+
105
+
106
+
107
+ <small>&copy; 2017 fruvege Inc.</small>
108
+
109
+ </div>
110
+
111
+ </footer>
112
+
113
+ <!--フッターここまで-->
114
+
115
+ </body>
116
+
117
+ </html>
118
+
119
+ ```
120
+
121
+ 以下、about.html(おそらくきちんと反映されているhtml)
122
+
123
+ ```
124
+
125
+ <!DOCTYPE html>
126
+
127
+ <html lang="ja">
128
+
129
+ <head>
130
+
131
+ <meta charset="UTF-8">
132
+
133
+ <link href="css/style.css" rel="stylesheet">
134
+
135
+ <title>fruvegeとは|fruvege</title>
136
+
137
+ </head>
138
+
139
+ <body>
140
+
141
+ <header>
142
+
143
+ <div class="header_box">
144
+
145
+ <h1><a href="index.html"><img src="images/logo_header.png" alt="フルベジロゴ" width="240" height="55"></a></h1>
146
+
147
+ <nav>
148
+
149
+ <ul>
150
+
151
+ <li><a href="index.html">ホーム</a></li>
152
+
153
+ <li><a href="fruit.html">フルーツ</a></li>
154
+
155
+ <li><a href="vegetable.html">ベジタブル</a></li>
156
+
157
+ <li><a href="about.html">fruvegeとは</a></li>
158
+
159
+ </ul>
160
+
161
+ </nav>
162
+
163
+ </div>
164
+
165
+ </header>
166
+
167
+ <!--ヘッダ-ーこまで-->
168
+
169
+ <main>
170
+
171
+ <div class="main_box">
172
+
173
+ <h2>about fruvege</h2>
174
+
175
+ <section>
176
+
177
+ <h3>fruvege情報</h3>
178
+
179
+ <table>
180
+
181
+ <tr><th>名称</th>
182
+
183
+ <td>fruvege株式会社</td>
184
+
185
+ </tr>
186
+
187
+ <tr>
188
+
189
+ <th>住所</th>
190
+
191
+ <td>東京新宿区中新宿1-2-3</td>
192
+
193
+ </tr>
194
+
195
+ <tr>
196
+
197
+ <th>電話</th>
198
+
199
+ <td>03-1111-2222</td>
200
+
201
+ </tr>
202
+
203
+ <tr>
204
+
205
+ <th>創立</th>
206
+
207
+ <td>2007年4月</td>
208
+
209
+ </tr>
210
+
211
+ <tr>
212
+
213
+ <th>資本金</th>
214
+
215
+ <td>1億円</td>
216
+
217
+ </tr>
218
+
219
+ <tr>
220
+
221
+ <th>営業時間</th>
222
+
223
+ <td>11時から19時まで</td>
224
+
225
+ </tr>
226
+
227
+ <tr>
228
+
229
+ <th>メールでのお問い合わせ</th>
230
+
231
+ <td>お試し@gmail.com</td>
232
+
233
+ </tr>
234
+
235
+ </table>
236
+
237
+ </section>
238
+
239
+ <section>
240
+
241
+ <h3>fruvegeCM</h3>
242
+
243
+ <video src="images/cm.mp4" controls="controls">
244
+
245
+ </video>
246
+
247
+ </section>
248
+
249
+ </div>
250
+
251
+ </main>
252
+
253
+ <!--メインここまで-->
254
+
255
+ <footer>
256
+
257
+ <div class="footer_box">
258
+
259
+ <p><img src="images/logo_footer.png" alt="フルベジロゴ" width="141" height="39"></p>
260
+
261
+ <small>&copy; 2017 fruvege Inc.</small>
262
+
263
+ </div>
264
+
265
+ </footer>
266
+
267
+ <!--フッーここまで-->
268
+
269
+ </body>
270
+
271
+ </html>
272
+
273
+
274
+
275
+ ```
276
+
277
+ 以下、style.CSSです。
278
+
279
+ ```
280
+
281
+ @charset "utf-8";
282
+
283
+
284
+
285
+ html{
286
+
287
+ font-size: 16px;
288
+
289
+ }
290
+
291
+
292
+
293
+ body{
294
+
295
+ color: #666666;
296
+
297
+ font-family: sans-serif;
298
+
299
+ letter-spacing: 2px;
300
+
301
+ margin: 0;
302
+
303
+ min-width: 1024px;
304
+
305
+ }
306
+
307
+ h1{
308
+
309
+ margin: 0;
310
+
311
+ }
312
+
313
+ h2{
314
+
315
+ font-size: 3rem;
316
+
317
+ font-family: Arial , sans-serif;
318
+
319
+ color: #000000;
320
+
321
+ border-left: 30px solid #d7391d ;
322
+
323
+ border-radius: 10px 0 0 10px;
324
+
325
+ padding-left: 10px;
326
+
327
+ }
328
+
329
+ strong{
330
+
331
+ font-weight: normal;
332
+
333
+ color: #ee7600;
334
+
335
+ }
336
+
337
+ footer{
338
+
339
+ text-align: right;
340
+
341
+ background-color: #486b0b;
342
+
343
+ color: #ffffff;
344
+
345
+ padding: 30px 0;
346
+
347
+ }
348
+
349
+ p{
350
+
351
+ line-height: 2;
352
+
353
+ }
354
+
355
+ header{
356
+
357
+ border-bottom: 5px dotted #d7301d ;
358
+
359
+ padding: 30px 0;
360
+
361
+ }
362
+
363
+ main{
364
+
365
+ padding: 30px 0;
366
+
367
+ }
16
368
 
17
369
  .header_box,.main_box,.footer_box{
18
370
 
@@ -22,7 +374,47 @@
22
374
 
23
375
  }
24
376
 
25
-
377
+ /* absoluteの場合 */
378
+
379
+ .parent {
380
+
381
+ position:relative;
382
+
383
+ }
384
+
385
+ .child {
386
+
387
+ positon: absolute;
388
+
389
+ width: 1024px;
390
+
391
+ margin: 0 auto;
392
+
393
+ left: 0;
394
+
395
+ right: 0;
396
+
397
+ }
398
+
399
+
400
+
401
+
402
+
403
+ /* flexの場合 */
404
+
405
+ .parent {
406
+
407
+ display: flex;
408
+
409
+ justify-content: center;
410
+
411
+ }
412
+
413
+ .child {
414
+
415
+ width: 1024px;
416
+
417
+ }
26
418
 
27
419
  ```
28
420