有如下代码
<style>.formtabs .panel { display: none; }.formtabs .panel:first-child { display: block; }.formtabs input[name="tabs"]:checked ~ .panels .panel { display: none; }.formtabs input[name="tabs"]:nth-of-type(1):checked ~ .panels .panel:nth-child(1),.formtabs input[name="tabs"]:nth-of-type(2):checked ~ .panels .panel:nth-child(2),.formtabs input[name="tabs"]:nth-of-type(3):checked ~ .panels .panel:nth-child(3) { display: block; }</style><div class="formtabs"> <input id="one" name="tabs" type="radio" checked> <input id="two" name="tabs" type="radio"> <input id="three" name="tabs" type="radio"> <div class="panels"> <form method="post" action="" class="form"> <!-- <input type="hidden" name=""> --> <div class="panel">11</div> <div class="panel">22</div> <div class="panel">33</div> </form> </div> </div>
:nth-of-type(1)
:nth-of-type(1)
HTML怎么学习?HTML怎么入门?HTML在哪学?HTML怎么学才快?不用担心,这里为大家提供了HTML速学教程(入门课程),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号