我正在尝试制作一个包含默认选项列表的表单,并且还可以扩展以显示几个 exta 选项。我使用以下 CSS 代码执行此操作:
.myForm .moreOpts {display:none;}
.myForm #more:checked +*+ .moreOpts {display:block;}
使用以下 HTML:
<form action="#" class="myForm">
<ul>
<li>
<input type="checkbox" id="pref-1" name="pref-1" value="1">
<label for="pref-1">Foo</label>
</li>
<li>
<input type="checkbox" id="pref-2" name="pref-2" value="2">
<label for="pref-2">Bar</label>
</li>
<li>
<input type="checkbox" id="more" name="more" value="true">
<label for="more">More options</label>
<ul class="moreOpts">
<li>
<input type="checkbox" id="pref-3" name="pref-3" value="3">
<label for="pref-3">Baz</label>
</li>
<li>
<input type="checkbox" id="pref-4" name="pref-4" value="3">
<label for="pref-4">Qux</label>
</li>
</ul>
</li>
</ul>
</form>
此代码在除Android Browser和Dolphin之外的所有浏览器中都能完美运行。我发现一篇文章建议添加此“错误修复”,但这仅解决了我在 Dolphin 中的问题。
有没有办法让默认的 Android 浏览器也能正常工作?