JSFiddle - React, Tailwind, and code Playground
HTML
<ul class="tabs">
<li>
<input type="radio" name="tabs" id="tab1" checked />
<label for="tab1">Description</label>
<div id="tab-content1" class="tab-content">
<p>content 1</p>
</div>
</li>
<li>
<input type="radio" name="tabs" id="tab2" />
<label for="tab2">Specification</label>
<div id="tab-content2" class="tab-content">
<p>content 2</p>
</div>
</li>
</ul>
<br style="clear: both;" />
CSS
* {
margin: 0;
padding: 0;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
body {
padding: 20px;
text-align: left;
color: #000;
}
h1 span {
font-size: 13px;
display: block;
padding-left: 4px;
}
.tabs {
width: 650px;
float: none;
list-style: none;
position: relative;
margin: 80px 0 0 10px;
text-align: left;
}
.tabs li {
float: left;
display: block;
}
.tabs input[type="radio"] {
position: absolute;
top: -9999px;
left: -9999px;
}
.tabs label {
display: block;
padding: 14px 21px;
border-radius: 2px 2px 0 0;
font-size: 20px;
font-weight: normal;
text-transform: uppercase;
background: #S6S6S6;
cursor: pointer;
position: relative;
}
.tabs label:hover {
background: #A6A6A6;
}
.tabs .tab-content {
z-index: 2;
display: none;
overflow: hidden;
width: 100%;
font-size: 17px;
line-height: 25px;
padding: 25px;
position: absolute;
top: 53px;
left: 0;
background: #E6E6E6;
}
.tabs [id^="tab"]:checked + label {
padding-top: 17px;
background: #B6B6B6;
}
.tabs [id^="tab"]:checked ~ [id^="tab-content"] {
display: block;
}
p.link {
clear: both;
margin: 380px 0 0 15px;
}
p.link a {
text-transform: uppercase;
text-decoration: none;
display: inline-block;
color: #fff;
padding: 5px 10px;
margin: 0 5px;
background-color: #612e76;
-moz-transition: all 0.2s ease-in;
-o-transition: all 0.2s ease-in;
-webkit-transition: all 0.2s ease-in;
transition: all 0.2s ease-in;
}
p.link a:hover {
background-color: #522764;
}