我也有同样的问题,没有找到答案。但我也找到了一个没有JavaScript的解决方案。您只能使用CSS+HTML创建选项卡。有点像:
CSS:
<style type="text/css">
#tabs div
{
width: 200px;
padding: 25px 0;
margin: 0;
position: relative;
}
#contents div
{
display: none;
position: absolute;
left: 200px;
top: 0;
width: 200%;
margin-left: 20px;
}
#contents div:target
{
display: block;
}
//And add more features to make it pretty
</style>
HTML:
<div id="tabs">
<div id="menu">
<ul>
<li><a href="#1">Datos 1</a></li>
<li><a href="#2">2</a></li>
<li><a href="#3">3</a></li>
</ul>
</div>
<div id="contents">
<div id="1" class="tabcontent">1</div>
<div id="2" class="tabcontent">2</div>
<div id="3" class="tabcontent">3</div>
</div>
</div>
//Sería un ejemplo básico