回答編集履歴

1

コメントを受けて追記

2019/03/16 05:16

投稿

Lhankor_Mhy
Lhankor_Mhy

スコア36074

test CHANGED
@@ -61,3 +61,165 @@
61
61
  }
62
62
 
63
63
  ```
64
+
65
+
66
+
67
+ ##### コメントを受けて追記
68
+
69
+ ```html
70
+
71
+ <input type="checkbox" id="label1" />
72
+
73
+ <div class="box-wrap">
74
+
75
+ <div>テキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキストテキスト</div>
76
+
77
+ <div><img src="http://placehold.jp/500x600.png">
78
+
79
+ <!-- クリック時のみ表示する領域 -->
80
+
81
+ <div class="hidden_box">
82
+
83
+ <label for="label1"></label>
84
+
85
+ </div></div>
86
+
87
+ <!-- / .box-wrap --></div>
88
+
89
+
90
+
91
+ <!-- なんか </div> がひとつ余ってたので消しました。 -->
92
+
93
+
94
+
95
+ <div class="hidden_show">
96
+
97
+ <!--非表示要素ここから-->
98
+
99
+ <p>テスト文章ですテスト文章ですテスト文章ですテスト文章ですテスト文章です</p>
100
+
101
+ </div>
102
+
103
+ <!--ここまで-->
104
+
105
+ ```
106
+
107
+ ```css
108
+
109
+ .box-wrap {
110
+
111
+ position:relative;
112
+
113
+ max-width:1500px;
114
+
115
+ width: 100%;
116
+
117
+ text-align:center;
118
+
119
+ }
120
+
121
+ .box-wrap div {
122
+
123
+ display:inline-block;
124
+
125
+ width: 30%;
126
+
127
+ margin: 0;
128
+
129
+ padding:0;
130
+
131
+ text-align:left;
132
+
133
+ }
134
+
135
+
136
+
137
+ /* */
138
+
139
+
140
+
141
+ .hidden_box {
142
+
143
+ position:absolute;
144
+
145
+ right: 40px;
146
+
147
+ bottom: 30px;
148
+
149
+ cursor :pointer;
150
+
151
+ }
152
+
153
+
154
+
155
+ .hidden_box label {
156
+
157
+ width: 154px;
158
+
159
+ height: 29px;
160
+
161
+ background:url("http://placehold.jp/24/cc9999/993333/154x29.png") no-repeat center top;
162
+
163
+ display: block;
164
+
165
+ }
166
+
167
+
168
+
169
+ /*ボタンを切り替え*/
170
+
171
+ input:checked#label1 ~ .box-wrap label {
172
+
173
+ width: 154px;
174
+
175
+ height: 29px;
176
+
177
+ background:url("http://placehold.jp/24/000000/993333/154x29.png") no-repeat center top;
178
+
179
+ display: block;
180
+
181
+ }
182
+
183
+
184
+
185
+ /*チェックは見えなくする*/
186
+
187
+ input#label1 {
188
+
189
+ display: none;
190
+
191
+ }
192
+
193
+
194
+
195
+ /*中身を非表示にしておく*/
196
+
197
+ .hidden_show {
198
+
199
+ height: 0;
200
+
201
+ padding: 0;
202
+
203
+ overflow: hidden;
204
+
205
+ opacity: 0;
206
+
207
+ transition: 0.8s;
208
+
209
+ }
210
+
211
+
212
+
213
+ /*クリックで中身表示*/
214
+
215
+ input:checked#label1 ~ .hidden_show {
216
+
217
+ padding: 10px 0;
218
+
219
+ height: auto;
220
+
221
+ opacity: 1;
222
+
223
+ }
224
+
225
+ ```