css tabs:active
by Imri Paloja
HTML
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/skeleton/2.0.4/skeleton.min.css">
<div class="container">
<div class="tab-buttons">
<!-- <a href='#London' class="button">London</a> -->
<div class="button london">London</div>
<!-- <a href='#Paris' class="button">Paris</a>
<a href='#Tokyo' class="button">Tokyo</a> -->
</div>
<section id='London' class="tabcontent">
<h3>London</h3>
<p>London is the capital city of England.</p>
<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="Paris" class="tabcontent">
<h3>Paris</h3>
<p>Paris is the capital of France.</p>
</section>
<section id="Tokyo" class="tabcontent">
<h3>Tokyo</h3>
<p>Tokyo is the capital of Japan.</p>
</section>
</div>
CSS
html,
body {
color: #454545;
}
.container {
margin-top: 1%;
}
.container .tab-buttons {
background: #F9F9F9;
border: 1px solid #CCCCCC;
margin: 0px;
padding: 0px;
}
.container .tab-buttons .button {
border: 0px none;
margin: 0px;
padding: 0px 20px 0px 20px;
}
.container .tab-buttons .button:hover {
background: #EEEEEE;
}
.container .tab-buttons .london:active #london {
background: #EEEEEE;
}
.tabcontent {
display: none;
}
.tabcontent:active : {
display: block;
}
.tabcontent {
background: #F9F9F9 !important;
border: 1px solid #CCC;
margin-top: -1px !important;
padding: 20px 30px;
}