I am using the code below for a form with multiple "tabs", and I would like tabs 1-4 to appear above tabs 5-8 on two lines. However, tabs 1-4 appear normally, but tabs 5-8 are truncated, they do not appear on the bottom line as I would expect to be float.
Could you help me change the code, so that the 5-8 tabs appear below the 1-4 tabs, as in this image?
Hereisthecode:
.nav_tabs{
width: 500px;
height: 400px;
margin: 5px 0;
position: relative;
}
.nav_tabs ul{
list-style: none;
}
.nav_tabs ul li{
float: left;
}
.tab_label{
display: block;
width: 100px;
background-color: #D8D8D8;
padding: 2px;
font-size: 16px;
color:black;
cursor: pointer;
border-right: solid 1px #A4A4A4;
text-align: center;
}
.nav_tabs .rd_tab {
display:none;
position: absolute;
}
.nav_tabs .rd_tab:checked ~ label {
background-color: #08298A;
color:#fff;
border: none;
}
.tab-content{
border-top: solid 5px #08298A;
background-color: #fff;
display: none;
position: absolute;
height: 300px;
width: 420px;
left: 40px;
}
.rd_tab:checked ~ .tab-content{
display: block;
}
<nav class="nav_tabs">
<ul>
<li>
<input type="radio" class="rd_tab" id="tab1" name="tabs" checked>
<label for="tab1" class="tab_label">ABA 1</label>
<div class="tab-content">
Conteúdo Aba 1
</div>
</li>
<li>
<input type="radio" class="rd_tab" id="tab2" name="tabs">
<label for="tab2" class="tab_label">ABA 2</label>
<div class="tab-content">
Conteúdo Aba 2
</div>
</li>
<li>
<input type="radio" class="rd_tab" id="tab3" name="tabs">
<label for="tab3" class="tab_label">ABA 3</label>
<div class="tab-content">
Conteúdo Aba 3
</div>
</li>
<li>
<input type="radio" class="rd_tab" id="tab4" name="tabs">
<label for="tab4" class="tab_label">ABA 4</label>
<div class="tab-content">
Conteúdo Aba 4
</div>
</li>
<li>
<input type="radio" class="rd_tab" id="tab5" name="tabs">
<label for="tab5" class="tab_label">ABA 5</label>
<div class="tab-content">
Conteúdo Aba 5
</div>
</li>
<li>
<input type="radio" class="rd_tab" id="tab6" name="tabs">
<label for="tab6" class="tab_label">ABA 6</label>
<div class="tab-content">
Conteúdo Aba 6
</div>
</li>
<li>
<input type="radio" class="rd_tab" id="tab7" name="tabs">
<label for="tab7" class="tab_label">ABA 7</label>
<div class="tab-content">
Conteúdo Aba 7
</div>
</li>
<li>
<input type="radio" class="rd_tab" id="tab8" name="tabs">
<label for="tab8" class="tab_label">ABA 8</label>
<div class="tab-content">
Conteúdo Aba 8
</div>
</li>
</ul>
</nav>