JSFiddle - React, Tailwind, and code Playground
HTML
<ul id="tabs">
<li><a href="#" name="tab1">One</a></li>
<li><a href="#" name="tab2">Two</a></li>
</ul>
<div id="content">
<div id="tab1">
<ul class="reference">
<li>CSS-Tuts+ - <a class="symbol" href="http://www.under-88.blogspot.com/">www.under-88.blogspot.com</a></li>
<li>CSS-Tricks - <a class="symbol" href="http://www.css-tricks.com/" rel="nofollow" target="_blank">www.css-tricks.com</a></li>
<li>jQuery - <a class="symbol" href="http://www.jquery.com/" rel="nofollow" target="_blank">www.jquery.com</a></li>
<li>CSS-Tutorial - <a class="symbol" href="http://www.w3schools.com/" rel="nofollow" target="_blank">www.w3schools.com </a></li>
<li>Web Design - <a class="symbol" href="http://www.tympanus.net/codrops/" rel="nofollow" target="_blank">www.tympanus.net</a></li>
<li>Red Team Design - <a class="symbol" href="http://www.red-team-design.com/" rel="nofollow" target="_blank">www.red-team-design.com</a></li>
</ul>
</div>
<div id="tab2">...</div>
</div>
CSS
body{padding:20px;background:#aaa;}
#tabs{
overflow: hidden;
width: 100%;
margin: 0;
padding: 0;
list-style: none;
}
#tabs li{
float: left;
margin: 0 .5em 0 0;
}
#tabs a{
position: relative;
background: #ddd;
background-image: linear-gradient(to bottom, #fff, #ddd);
padding: .7em 3.5em;
float: left;
text-decoration: none;
color: #444;
text-shadow: 0 1px 0 rgba(255,255,255,.8);
border-radius: 5px 0 0 0;
box-shadow: 0 2px 2px rgba(0,0,0,.4);
}
#tabs a:hover,
#tabs a:hover::after,
#tabs a:focus,
#tabs a:focus::after{
background: #fff;
}
#tabs a:focus{
outline: 0;
}
#tabs a::after{
content:'';
position:absolute;
z-index: 1;
top: 0;
right: -.5em;
bottom: 0;
width: 1em;
background: #ddd;
background-image: linear-gradient(to bottom, #fff, #ddd);
box-shadow: 2px 2px 2px rgba(0,0,0,.4);
transform: skew(10deg);
border-radius: 0 5px 0 0;
}
#tabs #current a,
#tabs #current a::after{
background: #fff;
z-index: 3;
}
#content
{
background: #fff;
padding: 2em;
height: 220px;
position: relative;
z-index: 2;
border-radius: 0 5px 5px 5px;
box-shadow: 0 -2px 3px -2px rgba(0, 0, 0, .5);
}
JavaScript
$(document).ready(function() {
$("#content div").hide(); // Awalnya menyembunyikan isi semua
$("#tabs li:first").attr("id","current"); // Aktifkan tab pertama
$("#content div:first").fadeIn(); // Tampilkan isi tab pertama
$('#tabs a').click(function(e) {
e.preventDefault();
if ($(this).closest("li").attr("id") == "current"){ //deteksi untuk tab saat ini kembali
}
else{
$("#content div").hide(); //Sembunyikan semua konten
$("#tabs li").attr("id",""); //Reset id's
$(this).parent().attr("id","current"); // Tabs yang aktive
$('#' + $(this).attr('name')).fadeIn(); // Tampilkan konten untuk tab saat ini
}
});
});
$(".symbol[href^='http']").each(function() {
$(this).css({
background: "url(http://g.etfv.co/" + this.href + ") left center no-repeat",
"padding-left": "20px"
});
});