Skip to content

Instantly share code, notes, and snippets.

@sakamies
Created April 8, 2012 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sakamies/2337109 to your computer and use it in GitHub Desktop.
Save sakamies/2337109 to your computer and use it in GitHub Desktop.
Transparent Tabs
/* Transparent Tabs */
.tabs {
list-style: none;
padding: 0;
overflow: hidden;
}
.tab {
display: block;
float: left;
padding: 10px;
}
.tab.active {
position: relative;
border: 2px solid rgba(0,0,0,.2);
border-bottom: none;
border-radius: 4px 4px 0px 0px;
}
.tab.active::after,
.tab.active::before {
display: block;
content: '';
position: absolute;
bottom: 0;
height: 0px;
width: 999em;
border-bottom: 2px solid rgba(0,0,0,.2);
pointer-events: none;
}
.tab.active::before {
right: 100%;
margin-right: 2px;
}
.tab.active::after {
left: 100%;
margin-left: 2px;
}
/* clearfix */
/* striped background */
body {
font-family: sans-serif;
background: hsl(70, 100%, 40%);
background-image: linear-gradient(45deg, hsla(0, 100%, 100%, .2) 25%, transparent 25%, transparent 50%, hsla(0, 100%, 100%, .2) 50%, hsla(0, 100%, 100%, .2) 75%, transparent 75%, transparent);
background-size: 50px 50px;
color: rgba(0,0,0,.6)
}
a {
color: inherit;
text-decoration: none;
}
<h1>Transparent Tabs</h1>
<ul class="tabs">
<li><a class="tab" href="#">Tab 1</a></li>
<li><a class="active tab" href="#">Tab 2</a></li>
<li><a class="tab" href="#">Tab 3</a></li>
<li><a class="tab" href="#">Tab 4</a></li>
</ul>
{"view":"separate","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment