3
I am making a TAB component in HTML + CSS, and I have a question regarding css, the code I have is as follows:
@import url("https://fonts.googleapis.com/css?family=Open+Sans:300,400,700");
.tabs {
font-family: "Open Sans", sans-serif;
width: 222px;
border: 1px solid #E6E6E6;
border-radius: 3px; }
.tabs__tab-list {
list-style: none;
height: 40px;
padding: 0;
margin: -1px;
font-size: 14px;
font-weight: 700;
background-color: #F2F2F2;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
border-top: 1px solid #E6E6E6;
border-right: 1px solid #E6E6E6;
border-left: 1px solid #E6E6E6; }
.tabs__tab {
display: inline;
padding: 0;
margin: 0;
border: 0; }
.tabs__tab:first-child {
float: left;
width: 46%;
height: 40px;
padding-left: 15px;
display: table;
border-top-left-radius: 3px;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
border-right: 1px solid #E6E6E6;
background-color: #FFFFFF; }
.tabs__tab:last-child {
float: right;
width: 54%;
height: 40px;
text-align: right;
display: table;
padding-right: 15px;
border-bottom: 1px solid #E6E6E6;
border-bottom-left-radius: 3px; }
.tabs__tab--selected {
color: pink; }
.tabs__tab__text {
display: table-cell;
vertical-align: middle; }
.tabs__content {
clear: both;
padding: 10px; }
<div class="tabs">
<ul class="tabs__tab-list">
<li class="tabs__tab">
<span class="tabs__tab__text">Tab1</span>
</li>
<li class="tabs__tab">
<span class="tabs__tab__text">
Tab2
</span>
</li>
</ul>
<div class="tabs__content">
<h1>Tab2</h1>
</div>
</div>
How can I prepare this component to carry n separators, and the edges are shown correctly? Any example/tip that advise me? Thank you
You who remove the edges ?
– Matheus Vitor
No, I want the edge effect of the gray area.
– Cláudio Hilário
Good morning, all right ? I think you better put 3 Divs and set the sizes you want, and go fiddling with the display of the Divs, to go leaving one next to the other or one at the bottom one above, ai vc gives the edge to the div vc uses much less code.
– Guilherme