回答編集履歴
1
修正
test
CHANGED
@@ -45,3 +45,211 @@
|
|
45
45
|
}
|
46
46
|
|
47
47
|
```
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
---
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
追記:
|
56
|
+
|
57
|
+
最終的な姿がわからないので勘になってしまいますが、こちらでいかがでしょうか?
|
58
|
+
|
59
|
+
<label>内に<input type="checkbox">を置くと、「サイト利用規約」など文字の部分も押せるようになるので
|
60
|
+
|
61
|
+
そのようにしています。
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
```HTML
|
66
|
+
|
67
|
+
<div class="ac-container">
|
68
|
+
|
69
|
+
<div>
|
70
|
+
|
71
|
+
<label for="ac-1">
|
72
|
+
|
73
|
+
<input id="ac-1" name="accordion-1" type="checkbox">
|
74
|
+
|
75
|
+
サイト利用規約
|
76
|
+
|
77
|
+
</label>
|
78
|
+
|
79
|
+
<label for="ac-1">
|
80
|
+
|
81
|
+
<input id="ac-2" name="accordion-2" type="checkbox">
|
82
|
+
|
83
|
+
個人情報保護方針
|
84
|
+
|
85
|
+
</label>
|
86
|
+
|
87
|
+
</div>
|
88
|
+
|
89
|
+
</div>
|
90
|
+
|
91
|
+
```
|
92
|
+
|
93
|
+
```CSS
|
94
|
+
|
95
|
+
.ac-container {
|
96
|
+
|
97
|
+
width: auto;
|
98
|
+
|
99
|
+
margin: 30px auto;
|
100
|
+
|
101
|
+
text-align: center;
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
display: flex; /* 追加 */
|
106
|
+
|
107
|
+
justify-content: center; /* 追加 */
|
108
|
+
|
109
|
+
}
|
110
|
+
|
111
|
+
.ac-container label {
|
112
|
+
|
113
|
+
/* width: 75%; */
|
114
|
+
|
115
|
+
text-align: left;
|
116
|
+
|
117
|
+
background: #e6eae3;
|
118
|
+
|
119
|
+
margin: 0 auto;
|
120
|
+
|
121
|
+
padding: 5px 5px 5px 5px;
|
122
|
+
|
123
|
+
position: relative;
|
124
|
+
|
125
|
+
display: block;
|
126
|
+
|
127
|
+
height: 40px;
|
128
|
+
|
129
|
+
cursor: pointer;
|
130
|
+
|
131
|
+
color: #56564b;
|
132
|
+
|
133
|
+
}
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
.ac-container label:hover {
|
138
|
+
|
139
|
+
background: #d4dcd6;
|
140
|
+
|
141
|
+
-webkit-transition: all .3s;
|
142
|
+
|
143
|
+
transition: all .3s;
|
144
|
+
|
145
|
+
}
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
.ac-container label:before {
|
150
|
+
|
151
|
+
color: #56564b;
|
152
|
+
|
153
|
+
font-family: "FontAwesome";
|
154
|
+
|
155
|
+
content: "\f055";
|
156
|
+
|
157
|
+
}
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
.ac-container input:checked~label::before {
|
162
|
+
|
163
|
+
color: #56564b;
|
164
|
+
|
165
|
+
font-family: "FontAwesome";
|
166
|
+
|
167
|
+
content: "\f056";
|
168
|
+
|
169
|
+
}
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
.ac-container input {
|
174
|
+
|
175
|
+
display: none;
|
176
|
+
|
177
|
+
}
|
178
|
+
|
179
|
+
/*
|
180
|
+
|
181
|
+
.ac-container div {
|
182
|
+
|
183
|
+
background: rgba(255, 255, 255, 0.5);
|
184
|
+
|
185
|
+
margin-top: -1px;
|
186
|
+
|
187
|
+
overflow: hidden;
|
188
|
+
|
189
|
+
height: 0px;
|
190
|
+
|
191
|
+
position: relative;
|
192
|
+
|
193
|
+
z-index: 10;
|
194
|
+
|
195
|
+
transition: height 0.3s ease-in-out, box-shadow 0.6s linear;
|
196
|
+
|
197
|
+
}
|
198
|
+
|
199
|
+
*/
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
.ac-container input:checked~div {
|
204
|
+
|
205
|
+
transition: height 0.5s ease-in-out, box-shadow 0.1s linear;
|
206
|
+
|
207
|
+
box-shadow: 0px 0px 0px 1px rgba(155, 155, 155, 0.3);
|
208
|
+
|
209
|
+
}
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
.ac-container div p {
|
214
|
+
|
215
|
+
color: #777;
|
216
|
+
|
217
|
+
line-height: 23px;
|
218
|
+
|
219
|
+
font-size: 14px;
|
220
|
+
|
221
|
+
padding: 20px;
|
222
|
+
|
223
|
+
}
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
/* 高さの定義 */
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
.ac-container input:checked~div.ac-small {
|
234
|
+
|
235
|
+
height: auto;
|
236
|
+
|
237
|
+
}
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
.ac-container input:checked~div.ac-medium {
|
242
|
+
|
243
|
+
height: 200px;
|
244
|
+
|
245
|
+
}
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
.ac-container input:checked~div.ac-large {
|
250
|
+
|
251
|
+
height: 300px;
|
252
|
+
|
253
|
+
}
|
254
|
+
|
255
|
+
```
|