JSFiddle - React, Tailwind, and code Playground
HTML
<div id="wp-header">
<header>
<h1>CSS Tabs - <a href="http://www.dumetschool.com/" target="_blank">www.dumetschool.com</a></h1>
<h3><a href="http://www.dumetschool.com/blog" target="_blank">Kembali ke Tutorial</a></h3>
</header>
<div id="content">
<input id="tab1" type="radio" name="tabs" checked>
<label for="tab1">Home</label>
<input id="tab2" type="radio" name="tabs" checked>
<label for="tab2">Products</label>
<input id="tab3" type="radio" name="tabs" checked>
<label for="tab3">About Us</label>
<section id="con1" class="size">
<h3>Welcome</h3>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
</section>
<section id="con2" class="size">
<h3>Products</h3>
<ul>
<li>Web Master</li>
<li>Web Programming</li>
<li>Graphic Design</li>
<li>Digital Marketing</li>
<li>Flash Animation</li>
<li>Video Editing</li>
</ul>
</section>
<section id="con3" class="size">
<h3>About Us</h3>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown...
CSS
/*****************************
SELAMAT DATANG DI DUMET SCHOOL
*****************************/
* {margin: 0; padding: 0;}
a {
text-decoration: none;
color: #FFF;
}
body {
font-family: Arial, Helvetica, sans-serif;
color: #ccc;
background: #618C94;
}
#wp-header {
margin: auto;
width: 565px;
padding: 10px;
}
#wp-header header {
padding: 20px 0 0 0;
}
#wp-header header h3 {
margin-bottom: 20px;
}
#wp-header header a {
text-transform: none;
color: #F90;
}
#wp-header header a:hover {
text-decoration: underline;
}
p, ul {
font-size: 13px;
}
/******************
STYLE TABS
******************/
#content {
width: 500px;
margin: 50px auto;
background: #CCC;
color: #333;
padding: 30px;
}
.size h3 {
margin: 20px 0;
}
input, section {
clear: both;
display: none;
padding: 10px;
}
label {
font-weight: bold;
font-size: 14px;
display: block;
float: left;
padding: 10px 30px;
border-top: 2px solid transparent;
border-right: 1px solid transparent;
border-left: 1px solid transparent;
border-bottom: 1px solid #DDD;
}
label:hover {
cursor: pointer;
text-decoration: underline;
}
#tab1:checked ~ #con1, #tab2:checked ~ #con2, #tab3:checked ~ #con3 {
display: block;
}
input:checked + label {
border-top-color: #B7977B;
border-right-color: #DDD;
border-left-color: #DDD;
border-bottom-color: transparent;
text-decoration: none;
}