回答編集履歴

1

追記

2016/10/27 05:28

投稿

gin
gin

スコア2722

test CHANGED
@@ -119,3 +119,89 @@
119
119
  </p></ul>
120
120
 
121
121
  ```
122
+
123
+ ###追記
124
+
125
+ ラジオボタンの箇所です。
126
+
127
+ これも`p`要素で囲まれていますね。
128
+
129
+ ```html
130
+
131
+ <!-- 理想 -->
132
+
133
+ <input id="panel-1-ctrl"
134
+
135
+ class="panel-radios" type="radio" name="tab-radios" checked>
136
+
137
+ <input id="panel-2-ctrl"
138
+
139
+ class="panel-radios" type="radio" name="tab-radios">
140
+
141
+ <input id="panel-3-ctrl"
142
+
143
+ class="panel-radios" type="radio" name="tab-radios">
144
+
145
+ <input id="panel-4-ctrl"
146
+
147
+ class="panel-radios" type="radio" name="tab-radios">
148
+
149
+ <input id="panel-5-ctrl"
150
+
151
+ class="panel-radios" type="radio" name="tab-radios">
152
+
153
+ <input id="nav-ctrl"
154
+
155
+ class="panel-radios" type="checkbox" name="nav-checkbox">
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+ <!-- 現実 -->
164
+
165
+ <p><!-- TAB CONTROLLERS --><br>
166
+
167
+ <input id="panel-1-ctrl" class="panel-radios" name="tab-radios" checked="" type="radio"><br>
168
+
169
+ <input id="panel-2-ctrl" class="panel-radios" name="tab-radios" type="radio"><br>
170
+
171
+ <input id="panel-3-ctrl" class="panel-radios" name="tab-radios" type="radio"><br>
172
+
173
+ <input id="panel-4-ctrl" class="panel-radios" name="tab-radios" type="radio"><br>
174
+
175
+ <input id="panel-5-ctrl" class="panel-radios" name="tab-radios" type="radio"><br>
176
+
177
+ <input id="nav-ctrl" class="panel-radios" name="nav-checkbox" type="checkbox"></p>
178
+
179
+ ```
180
+
181
+ `#panel-1`が開く際のコンテンツ部分のCSSはこうなっています。
182
+
183
+ ```css
184
+
185
+ #panel-1-ctrl:checked ~ #panels #panel-1 main {
186
+
187
+ max-height: initial;
188
+
189
+ opacity: 1;
190
+
191
+ padding: 48px 24px;
192
+
193
+ }
194
+
195
+ ```
196
+
197
+ `#panel-1-ctrl`にチェックが入ると表示させまっせと。
198
+
199
+ 問題は`~`。
200
+
201
+ これは兄弟要素を指定する間接セレクタです。
202
+
203
+ 兄`#panel-1-ctrl`と弟`#panels`の関係でなくてはならないのですが、`p`で囲まれてしまっているので`#panel-1-ctrl`の兄弟と呼べるものは`#panel-2-ctrl`~`#panel-5-ctrl`だけ。
204
+
205
+ `#panels`は親父`p`の弟という関係です。
206
+
207
+ 解決するには、どこからか現れた親父`p`を削除します。