質問編集履歴
2
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -43,3 +43,365 @@
|
|
43
43
|
![イメージ説明](edfe04248096c633640936e349e0729c.png)
|
44
44
|
|
45
45
|
期待した動き
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
###現状のコード
|
52
|
+
|
53
|
+
```html
|
54
|
+
|
55
|
+
<!DOCTYPE html>
|
56
|
+
|
57
|
+
<html lang="en">
|
58
|
+
|
59
|
+
<head>
|
60
|
+
|
61
|
+
<meta charset="UTF-8">
|
62
|
+
|
63
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
64
|
+
|
65
|
+
<link rel="stylesheet" href="index.css">
|
66
|
+
|
67
|
+
<title>Document</title>
|
68
|
+
|
69
|
+
</head>
|
70
|
+
|
71
|
+
<body>
|
72
|
+
|
73
|
+
<div class="container">
|
74
|
+
|
75
|
+
<div class="boxes">
|
76
|
+
|
77
|
+
<div class="content">
|
78
|
+
|
79
|
+
<div class="title">
|
80
|
+
|
81
|
+
<div class="txt">
|
82
|
+
|
83
|
+
<p>ボックスタイトル1</p>
|
84
|
+
|
85
|
+
</div>
|
86
|
+
|
87
|
+
</div>
|
88
|
+
|
89
|
+
<div class="test_block">
|
90
|
+
|
91
|
+
<div class="test_container">
|
92
|
+
|
93
|
+
<div class="test">
|
94
|
+
|
95
|
+
<p>test1</p>
|
96
|
+
|
97
|
+
</div>
|
98
|
+
|
99
|
+
<div class="test">
|
100
|
+
|
101
|
+
<p>test2</p>
|
102
|
+
|
103
|
+
</div>
|
104
|
+
|
105
|
+
<div class="test">
|
106
|
+
|
107
|
+
<p>test3</p>
|
108
|
+
|
109
|
+
</div>
|
110
|
+
|
111
|
+
<div class="test">
|
112
|
+
|
113
|
+
<p>test4</p>
|
114
|
+
|
115
|
+
</div>
|
116
|
+
|
117
|
+
</div>
|
118
|
+
|
119
|
+
</div>
|
120
|
+
|
121
|
+
</div>
|
122
|
+
|
123
|
+
<div class="content">
|
124
|
+
|
125
|
+
<div class="title">
|
126
|
+
|
127
|
+
<div class="txt">
|
128
|
+
|
129
|
+
<p>ボックスタイトル2</p>
|
130
|
+
|
131
|
+
</div>
|
132
|
+
|
133
|
+
</div>
|
134
|
+
|
135
|
+
<div class="test_block">
|
136
|
+
|
137
|
+
<div class="test_container">
|
138
|
+
|
139
|
+
<div class="test">
|
140
|
+
|
141
|
+
<p>test1</p>
|
142
|
+
|
143
|
+
</div>
|
144
|
+
|
145
|
+
<div class="test">
|
146
|
+
|
147
|
+
<p>test2</p>
|
148
|
+
|
149
|
+
</div>
|
150
|
+
|
151
|
+
<div class="test">
|
152
|
+
|
153
|
+
<p>test3</p>
|
154
|
+
|
155
|
+
</div>
|
156
|
+
|
157
|
+
<div class="test">
|
158
|
+
|
159
|
+
<p>test4</p>
|
160
|
+
|
161
|
+
</div>
|
162
|
+
|
163
|
+
</div>
|
164
|
+
|
165
|
+
</div>
|
166
|
+
|
167
|
+
</div>
|
168
|
+
|
169
|
+
<div class="content">
|
170
|
+
|
171
|
+
<div class="title">
|
172
|
+
|
173
|
+
<div class="txt">
|
174
|
+
|
175
|
+
<p>ボックスタイトル3</p>
|
176
|
+
|
177
|
+
</div>
|
178
|
+
|
179
|
+
</div>
|
180
|
+
|
181
|
+
<div class="test_block">
|
182
|
+
|
183
|
+
<div class="test_container">
|
184
|
+
|
185
|
+
<div class="test">
|
186
|
+
|
187
|
+
<p>test1</p>
|
188
|
+
|
189
|
+
</div>
|
190
|
+
|
191
|
+
<div class="test">
|
192
|
+
|
193
|
+
<p>test2</p>
|
194
|
+
|
195
|
+
</div>
|
196
|
+
|
197
|
+
<div class="test">
|
198
|
+
|
199
|
+
<p>test3</p>
|
200
|
+
|
201
|
+
</div>
|
202
|
+
|
203
|
+
<div class="test">
|
204
|
+
|
205
|
+
<p>test4</p>
|
206
|
+
|
207
|
+
</div>
|
208
|
+
|
209
|
+
</div>
|
210
|
+
|
211
|
+
</div>
|
212
|
+
|
213
|
+
</div>
|
214
|
+
|
215
|
+
<div class="content">
|
216
|
+
|
217
|
+
<div class="title">
|
218
|
+
|
219
|
+
<div class="txt">
|
220
|
+
|
221
|
+
<p>ボックスタイトル4</p>
|
222
|
+
|
223
|
+
</div>
|
224
|
+
|
225
|
+
</div>
|
226
|
+
|
227
|
+
<div class="test_block">
|
228
|
+
|
229
|
+
<div class="test_container">
|
230
|
+
|
231
|
+
<div class="test">
|
232
|
+
|
233
|
+
<p>test1</p>
|
234
|
+
|
235
|
+
</div>
|
236
|
+
|
237
|
+
<div class="test">
|
238
|
+
|
239
|
+
<p>test2</p>
|
240
|
+
|
241
|
+
</div>
|
242
|
+
|
243
|
+
<div class="test">
|
244
|
+
|
245
|
+
<p>test3</p>
|
246
|
+
|
247
|
+
</div>
|
248
|
+
|
249
|
+
<div class="test">
|
250
|
+
|
251
|
+
<p>test4</p>
|
252
|
+
|
253
|
+
</div>
|
254
|
+
|
255
|
+
</div>
|
256
|
+
|
257
|
+
</div>
|
258
|
+
|
259
|
+
</div>
|
260
|
+
|
261
|
+
</div>
|
262
|
+
|
263
|
+
</div>
|
264
|
+
|
265
|
+
<script
|
266
|
+
|
267
|
+
src="https://code.jquery.com/jquery-1.12.4.min.js"
|
268
|
+
|
269
|
+
integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ="
|
270
|
+
|
271
|
+
crossorigin="anonymous"></script>
|
272
|
+
|
273
|
+
<script>
|
274
|
+
|
275
|
+
$(function(){
|
276
|
+
|
277
|
+
$(".title").on("click", function() {
|
278
|
+
|
279
|
+
$(this).next().slideToggle();
|
280
|
+
|
281
|
+
});
|
282
|
+
|
283
|
+
});
|
284
|
+
|
285
|
+
</script>
|
286
|
+
|
287
|
+
</body>
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
</html>
|
292
|
+
|
293
|
+
```
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
```css
|
298
|
+
|
299
|
+
* {
|
300
|
+
|
301
|
+
box-sizing: border-box;
|
302
|
+
|
303
|
+
}
|
304
|
+
|
305
|
+
.container {
|
306
|
+
|
307
|
+
background-color: rgb(182, 210, 253);
|
308
|
+
|
309
|
+
height: 100vh;
|
310
|
+
|
311
|
+
}
|
312
|
+
|
313
|
+
.container .boxes {
|
314
|
+
|
315
|
+
width: 900px;
|
316
|
+
|
317
|
+
margin: 0 auto;
|
318
|
+
|
319
|
+
padding: 3rem 0;
|
320
|
+
|
321
|
+
/* display: flex;
|
322
|
+
|
323
|
+
flex-wrap: wrap; */
|
324
|
+
|
325
|
+
justify-content: space-between;
|
326
|
+
|
327
|
+
align-items: flex-start;
|
328
|
+
|
329
|
+
columns: 2;
|
330
|
+
|
331
|
+
column-fill: auto;
|
332
|
+
|
333
|
+
}
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
.container .boxes .content {
|
338
|
+
|
339
|
+
width: 80%;
|
340
|
+
|
341
|
+
background-color: rgb(187, 247, 172);
|
342
|
+
|
343
|
+
margin-bottom: 1rem;
|
344
|
+
|
345
|
+
}
|
346
|
+
|
347
|
+
.container .boxes .wrap {
|
348
|
+
|
349
|
+
break-before: column;
|
350
|
+
|
351
|
+
}
|
352
|
+
|
353
|
+
★↓のコメントアウトを外せば、期待した動きになる。
|
354
|
+
|
355
|
+
/* .container .boxes .content:nth-child(3) {
|
356
|
+
|
357
|
+
break-before: column;
|
358
|
+
|
359
|
+
} */
|
360
|
+
|
361
|
+
.container .boxes .content .title{
|
362
|
+
|
363
|
+
cursor: pointer;
|
364
|
+
|
365
|
+
padding: 0.43rem 1rem 0.43rem 0.5rem;
|
366
|
+
|
367
|
+
padding-bottom: 0.43rem;
|
368
|
+
|
369
|
+
border-bottom: 1px solid #383838;
|
370
|
+
|
371
|
+
}
|
372
|
+
|
373
|
+
.container .boxes .content .test_block {
|
374
|
+
|
375
|
+
display: none;
|
376
|
+
|
377
|
+
}
|
378
|
+
|
379
|
+
.container .boxes .content .test_block .test_container{
|
380
|
+
|
381
|
+
display: flex;
|
382
|
+
|
383
|
+
flex-direction: row;
|
384
|
+
|
385
|
+
flex-wrap: wrap;
|
386
|
+
|
387
|
+
background-color: #FDFDFD;
|
388
|
+
|
389
|
+
border-bottom: 1px solid #e7e7e7;
|
390
|
+
|
391
|
+
}
|
392
|
+
|
393
|
+
.container .boxes .content .test_block .test_container .test{
|
394
|
+
|
395
|
+
width: 50%;
|
396
|
+
|
397
|
+
padding: 13px 18px 13px 16px;
|
398
|
+
|
399
|
+
border-top: 1px solid #e7e7e7;
|
400
|
+
|
401
|
+
border-left: 1px solid #e7e7e7;
|
402
|
+
|
403
|
+
}
|
404
|
+
|
405
|
+
|
406
|
+
|
407
|
+
```
|
1
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -27,3 +27,19 @@
|
|
27
27
|
|
28
28
|
|
29
29
|
ですので、<style>この中</style>に書こうと考えました。
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
![![イメージ説明](2f2e24db588373eca8fcccd9bfbf9079.png)](a90f439aeb133af0a9b9f28e7d5afd16.png)
|
36
|
+
|
37
|
+
期待していない動き
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
![イメージ説明](edfe04248096c633640936e349e0729c.png)
|
44
|
+
|
45
|
+
期待した動き
|