Skip to content

Instantly share code, notes, and snippets.

@gentle-media
Created April 25, 2012 11:27
Show Gist options
  • Save gentle-media/2489062 to your computer and use it in GitHub Desktop.
Save gentle-media/2489062 to your computer and use it in GitHub Desktop.
CSS3 tabs (experimental)
/**
* CSS3 tabs (experimental)
*/
ul {
list-style: none;
margin: 0;
padding: 0}
.tabs {
position: relative}
.tab {
float: left;
width: 10%}
.tab a {
display: block;
text-decoration: none;}
.tab ul {
width: 50%;
opacity: 0;
position: absolute;
left: 0;
top: 30px;
padding: 20px;
background-color: #EEE;}
.tabs li:first-child ul, .tab a:hover ~ ul {
opacity: 1}
<div>
<ul class="tabs">
<li class="tab"><a href="#">tab 1</a>
<ul>
<li>tab content 1</li>
</ul>
</li>
<li class="tab"><a href="#">tab 2</a>
<ul>
<li>tab content 2</li>
</ul>
</li>
<li class="tab"><a href="#">tab 3</a>
<ul>
<li>tab content 3</li>
</ul>
</li>
</ul>
</div>
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment