Below is css only tabbed html implementation that I put together after scouring the internet
Edit: I am trying to avoid having to specify the min-height. The tab contents vary greatly, and i want to display the whole content (without the scroll bar)
.tabs {
position: relative;
bottom: -1px;
}
.tab {
float: left;
}
.tab label {
padding: 10px;
margin-left: 0px;
position: relative;
border: 1px solid #ccc;
background: white;
height: 100%;
line-height: 18px;
overflow: hidden;
text-align: center;
font-size: 14px;
font-family: Arial;
z-index: 1;
cursor: pointer;
}
.tab [type=radio] {
display: none;
}
.content {
position: absolute;
top: 28px;
left: 0;
right: 0;
background: white;
z-index: 1;
display: none;
min-width: 700px;
padding: 18px 12px;
border: 1px solid #ccc;
}
[type=radio]:checked~label {
background-color: #ddd;
z-index: 2;
}
[type=radio]:checked~label~.content {
z-index: 2;
display: block;
}
<div class="tabs">
<div class="tab">
<input type="radio" id="tab-1-report" name="tab-group-report">
<label for="tab-1-report">Tab 1</label>
<div class="content">
<p> Some contents</p>
<p> Some contents</p>
<br/>
</div>
</div>
<div class="tab">
<input type="radio" id="tab-2-report" name="tab-group-report">
<label for="tab-2-report">Tab 2</label>
<div class="content">
<div class="tabs">
<div class="tab">
<input type="radio" id="tab-1-strategy_1" name="tab-group-strategy_1">
<label for="tab-1-strategy_1">Tab 2-1</label>
<div class="content">
<p> Some contents</p>
<p> Some contents</p>
<p> Some contents</p>
<p> Some contents</p>
<p> Some contents</p>
</div>
</div>
<div class="tab">
<input type="radio" id="tab-2-strategy_1" name="tab-group-strategy_1">
<label for="tab-2-strategy_1">Tab 2-2</label>
<div class="content">
<p> Some contents</p>
<p> Some contents</p>
<p> Some contents</p>
<p> Some contents</p>
</div>
</div>
</div>
</div>
</div>
<div class="tab">
<input type="radio" id="tab-3-report" name="tab-group-report">
<label for="tab-3-report">Tab 3</label>
<div class="content">
<div class="tabs">
<div class="tab">
<input type="radio" id="tab-1-strategy_2" name="tab-group-strategy_2">
<label for="tab-1-strategy_2">Tab 3-1</label>
<div class="content">
<p> Some contents</p>
<p> Some contents</p>
<p> Some contents</p>
<p> Some contents</p>
</div>
</div>
</div>
</div>
</div>
</div>
<br/><br/>
<div>
<p>Footer</p>
</div>
It works nicely but I can't seem to make the "parent" tab height to follow "child" tab height. That's why we can see the messed up border and the missing "Footer" once a tab is clicked.
Any idea on how to fix this? Thanks.