質問編集履歴
2
モデルサイトのURLを追加しました、JavaScriptのコードはつかっていないです。
test
CHANGED
File without changes
|
test
CHANGED
@@ -367,3 +367,5 @@
|
|
367
367
|
```
|
368
368
|
|
369
369
|
![イメージ説明](3f904e5c985ceee41d1b091f57618a8b.jpeg)
|
370
|
+
|
371
|
+
[モデルサイト](http://www.shoeisha.com/book/hp/mcoding/2/)
|
1
htmlのコードとcssのコードを添付しました、画像の写真2枚は src="images/image_L_1.jpg"とsrc="images/image_M_1.jpg"に対応しています。
test
CHANGED
File without changes
|
test
CHANGED
@@ -2,7 +2,227 @@
|
|
2
2
|
|
3
3
|
参考書内ではMasonryを導入してレンガ状に並べています。
|
4
4
|
|
5
|
+
```<body>
|
6
|
+
|
7
|
+
<div class="flex">
|
8
|
+
|
9
|
+
<section class="item item-l item-maindish">
|
10
|
+
|
11
|
+
<a href="">
|
12
|
+
|
13
|
+
<img class="image" src="images/image_L_1.jpg" alt="">
|
14
|
+
|
15
|
+
<div class="category">main dish</div>
|
16
|
+
|
17
|
+
<p class="description">lorem ipsum dolor sit amey,conscrtetir adipisocinf elit,
|
18
|
+
|
19
|
+
seddoeois,odtempor i</p>
|
20
|
+
|
21
|
+
</a>
|
22
|
+
|
23
|
+
</section>
|
24
|
+
|
25
|
+
<section class="item item-m item-maindish">
|
26
|
+
|
27
|
+
<a href="">
|
28
|
+
|
29
|
+
<img class="image" src="images/image_M_1.jpg" alt="">
|
30
|
+
|
31
|
+
<div class="category">main dish</div>
|
32
|
+
|
33
|
+
<p class="description">lorem ipsum dolor sit amey,conscrtetir adipisocinf elit,
|
34
|
+
|
35
|
+
seddoeois,odtempor i</p>
|
36
|
+
|
37
|
+
</a>
|
38
|
+
|
39
|
+
</section>
|
40
|
+
|
41
|
+
<section class="item item-m item-maindish">
|
42
|
+
|
43
|
+
<a href="">
|
44
|
+
|
45
|
+
<img class="image" src="images/image_M_2.jpg" alt="">
|
46
|
+
|
47
|
+
<div class="category">main dish</div>
|
48
|
+
|
49
|
+
<p class="description">lorem ipsum dolor sit amey,conscrtetir adipisocinf elit,
|
50
|
+
|
51
|
+
seddoeois,odtempor i</p>
|
52
|
+
|
53
|
+
</a>
|
54
|
+
|
55
|
+
</section>
|
56
|
+
|
57
|
+
<section class="item item-maindish">
|
58
|
+
|
59
|
+
<a href="">
|
60
|
+
|
61
|
+
<img class="image" src="images/image_S_1.jpg" alt="">
|
62
|
+
|
63
|
+
<div class="category">main dish</div>
|
64
|
+
|
65
|
+
<p class="description">lorem ipsum dolor sit amey,conscrtetir adipisocinf elit,
|
66
|
+
|
67
|
+
seddoeois,odtempor i</p>
|
68
|
+
|
69
|
+
</a>
|
70
|
+
|
71
|
+
</section>
|
72
|
+
|
73
|
+
<section class="item item-apptizer">
|
74
|
+
|
75
|
+
<a href="">
|
76
|
+
|
77
|
+
<img class="image" src="images/image_S_2.jpg" alt="">
|
78
|
+
|
79
|
+
<div class="category">main dish</div>
|
80
|
+
|
81
|
+
<p class="description">lorem ipsum dolor sit amey,conscrtetir adipisocinf elit,
|
82
|
+
|
83
|
+
seddoeois,odtempor incididunt ipo dssd c </p>
|
84
|
+
|
85
|
+
</a>
|
86
|
+
|
87
|
+
</section>
|
88
|
+
|
89
|
+
<section class="item item-column">
|
90
|
+
|
91
|
+
<a href="">
|
92
|
+
|
93
|
+
<img class="image" src="images/image_S_3.jpg" alt="">
|
94
|
+
|
95
|
+
<div class="category">main dish</div>
|
96
|
+
|
97
|
+
<p class="description">lorem ipsum dolor sit amey,conscrtetir adipisocinf elit,
|
98
|
+
|
99
|
+
seddoeois,odtempor incididunt ipo</p>
|
100
|
+
|
101
|
+
</a>
|
102
|
+
|
103
|
+
</section>
|
104
|
+
|
105
|
+
<section class="item item-breaktime">
|
106
|
+
|
107
|
+
<a href="">
|
108
|
+
|
109
|
+
<img class="image" src="images/image_S_4.jpg" alt="">
|
110
|
+
|
111
|
+
<div class="category">main dish</div>
|
112
|
+
|
113
|
+
<p class="description">lorem ipsum dolor sit amey,conscrtetir adipisocinf elit,
|
114
|
+
|
115
|
+
seddoeois,odtempor</p>
|
116
|
+
|
117
|
+
</a>
|
118
|
+
|
119
|
+
</section>
|
120
|
+
|
121
|
+
<section class="item item-maindish">
|
122
|
+
|
123
|
+
<a href="">
|
124
|
+
|
125
|
+
<img class="image" src="images/image_S_5.jpg" alt="">
|
126
|
+
|
127
|
+
<div class="category">main dish</div>
|
128
|
+
|
129
|
+
<p class="description">lorem ipsum dolor sit amey,conscrtetir adipisocinf elit,
|
130
|
+
|
131
|
+
seddoeois,odtempor i</p>
|
132
|
+
|
133
|
+
</a>
|
134
|
+
|
135
|
+
</section> <section class="item item-maindish">
|
136
|
+
|
137
|
+
<a href="">
|
138
|
+
|
139
|
+
<img class="image" src="images/image_S_6.jpg" alt="">
|
140
|
+
|
141
|
+
<div class="category">main dish</div>
|
142
|
+
|
143
|
+
<p class="description">lorem ipsum dolor sit amey,conscrtetir adipisocinf elit,
|
144
|
+
|
145
|
+
seddoeois,odtempor i</p>
|
146
|
+
|
147
|
+
</a>
|
148
|
+
|
149
|
+
</section> <section class="item item-maindish">
|
150
|
+
|
151
|
+
<a href="">
|
152
|
+
|
153
|
+
<img class="image" src="images/image_S_7.jpg" alt="">
|
154
|
+
|
155
|
+
<div class="category">main dish</div>
|
156
|
+
|
157
|
+
<p class="description">lorem ipsum dolor sit amey,conscrtetir adipisocinf elit,
|
158
|
+
|
159
|
+
seddoeois,odtempor i</p>
|
160
|
+
|
161
|
+
</a>
|
162
|
+
|
163
|
+
</section> <section class="item item-maindish">
|
164
|
+
|
165
|
+
<a href="">
|
166
|
+
|
167
|
+
<img class="image" src="images/image_S_8.jpg" alt="">
|
168
|
+
|
169
|
+
<div class="category">main dish</div>
|
170
|
+
|
171
|
+
<p class="description">lorem ipsum dolor sit amey,conscrtetir adipisocinf elit,
|
172
|
+
|
173
|
+
seddoeois,odtempor i</p>
|
174
|
+
|
175
|
+
</a>
|
176
|
+
|
177
|
+
</section>
|
178
|
+
|
179
|
+
</div>
|
180
|
+
|
181
|
+
</body>
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
コード
|
186
|
+
|
187
|
+
```
|
188
|
+
|
189
|
+
```
|
190
|
+
|
191
|
+
html{
|
192
|
+
|
193
|
+
font-size: 62.5%;
|
194
|
+
|
195
|
+
}
|
196
|
+
|
197
|
+
body {
|
198
|
+
|
199
|
+
padding: 30px;
|
200
|
+
|
201
|
+
background-color: #f6f7fb;
|
202
|
+
|
203
|
+
color: #333;
|
204
|
+
|
205
|
+
font-size: 1.2rem;
|
206
|
+
|
207
|
+
font-family: "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
|
208
|
+
|
209
|
+
}
|
210
|
+
|
211
|
+
*,*::before,*::after{
|
212
|
+
|
213
|
+
box-sizing: border-box;
|
214
|
+
|
215
|
+
}
|
216
|
+
|
217
|
+
a:link,a:visited a:hover,a:active{
|
218
|
+
|
219
|
+
color:#7c5119;
|
220
|
+
|
221
|
+
text-decoration: none;
|
222
|
+
|
223
|
+
}
|
224
|
+
|
5
|
-
|
225
|
+
.flex{
|
6
226
|
|
7
227
|
display: flex;
|
8
228
|
|
@@ -16,6 +236,132 @@
|
|
16
236
|
|
17
237
|
|
18
238
|
|
239
|
+
.item{
|
240
|
+
|
241
|
+
margin: 2px;
|
242
|
+
|
243
|
+
width: 180px;
|
244
|
+
|
245
|
+
margin-bottom: 4px;
|
246
|
+
|
247
|
+
padding: 8px;
|
248
|
+
|
249
|
+
border-bottom: 3px solid;
|
250
|
+
|
251
|
+
border-radius: 5px;
|
252
|
+
|
253
|
+
background-color: #fff;
|
254
|
+
|
255
|
+
}
|
256
|
+
|
257
|
+
.item .image{
|
258
|
+
|
259
|
+
display: block;
|
260
|
+
|
261
|
+
width: 100%;
|
262
|
+
|
263
|
+
height: 109px;
|
264
|
+
|
265
|
+
}
|
266
|
+
|
267
|
+
.item .category{
|
268
|
+
|
269
|
+
margin: 15px 9px 10px;
|
270
|
+
|
271
|
+
color:#aaa;
|
272
|
+
|
273
|
+
letter-spacing: 1px;
|
274
|
+
|
275
|
+
font-family: "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
|
276
|
+
|
277
|
+
}
|
278
|
+
|
279
|
+
.item .category::before{
|
280
|
+
|
281
|
+
content: '';
|
282
|
+
|
283
|
+
display: inline-block;
|
284
|
+
|
285
|
+
width:19px;
|
286
|
+
|
287
|
+
height: 19px;
|
288
|
+
|
289
|
+
margin-right: 5px;
|
290
|
+
|
291
|
+
border:2px solid;
|
292
|
+
|
293
|
+
border-radius: 50%;
|
294
|
+
|
295
|
+
vertical-align: -5px;
|
296
|
+
|
297
|
+
}
|
298
|
+
|
299
|
+
.item-maindish,
|
300
|
+
|
301
|
+
.item-maindish .category::before{
|
302
|
+
|
303
|
+
border-color: #FFC0CB
|
304
|
+
|
305
|
+
}
|
306
|
+
|
307
|
+
.item-apptizer,
|
308
|
+
|
309
|
+
.item-apptizer .category::before{
|
310
|
+
|
311
|
+
border-color: yellow;
|
312
|
+
|
313
|
+
}
|
314
|
+
|
315
|
+
.item>a {
|
316
|
+
|
317
|
+
display: block;
|
318
|
+
|
319
|
+
margin:-8px -8px -11px;
|
320
|
+
|
321
|
+
padding: 8px 8px 11px;
|
322
|
+
|
323
|
+
border-radius: inherit;
|
324
|
+
|
325
|
+
color: #777;
|
326
|
+
|
327
|
+
transition: all 0.3s;
|
328
|
+
|
329
|
+
}
|
330
|
+
|
331
|
+
.item a:hover{
|
332
|
+
|
333
|
+
box-shadow: 0 0 6px -1px rgba(0,0,0,0.3);
|
334
|
+
|
335
|
+
opacity: 0.8;
|
336
|
+
|
337
|
+
}
|
338
|
+
|
339
|
+
.item-m{
|
340
|
+
|
341
|
+
width:364px;
|
342
|
+
|
343
|
+
}
|
344
|
+
|
345
|
+
.item-l{
|
346
|
+
|
347
|
+
width:732px;
|
348
|
+
|
349
|
+
}
|
350
|
+
|
351
|
+
.item-m .image{
|
352
|
+
|
353
|
+
height: 146px;
|
354
|
+
|
355
|
+
}
|
356
|
+
|
357
|
+
.item-l .image{
|
358
|
+
|
359
|
+
height: 403px;
|
360
|
+
|
361
|
+
}
|
362
|
+
|
363
|
+
|
364
|
+
|
19
365
|
コード
|
20
366
|
|
21
367
|
```
|