Skip to content

Instantly share code, notes, and snippets.

@f8lrebel
Created March 28, 2015 20:01
Show Gist options
  • Save f8lrebel/dc83eeddc78e9a7bdd41 to your computer and use it in GitHub Desktop.
Save f8lrebel/dc83eeddc78e9a7bdd41 to your computer and use it in GitHub Desktop.
Round Out Tabs (Bottom Version)
<ul class="tabrow">
<li class=""><a href="http://test.cosairus.com/shc/test.html#">TAB 1</a></li>
<li class=""><a href="http://test.cosairus.com/shc/test.html#">TAB 2</a></li>
<li class=""><a href="http://test.cosairus.com/shc/test.html#">TAB 3</a></li>
<li class=""><a href="http://test.cosairus.com/shc/test.html#">TAB 4</a></li>
<li class=""><a href="http://test.cosairus.com/shc/test.html#">TAB 5</a></li>
<li class="selected"><a href="http://test.cosairus.com/shc/test.html#">TAB 6</a></li>
</ul>
$("li").click(function(e) {
e.preventDefault();
$("li").removeClass("selected");
$(this).addClass("selected");
});
.tabrow {
text-align: center;
list-style: none;
margin: 50px 0 20px;
padding: 0;
line-height: 35px;
height: 37px;
overflow: hidden;
font-size: 12px;
font-family: arial;
position: relative;
}
.tabrow li {
border: 1px solid #AAA;
background: #D1D1D1;
background: -o-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
background: -ms-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
background: -moz-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
background: -webkit-linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
background: linear-gradient(top, #ECECEC 50%, #D1D1D1 100%);
display: inline-block;
position:relative;
z-index: 0;
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), inset 0 1px 0 #FFF;
text-shadow: 0 1px #FFF;
margin: 0 -5px;
padding: 0 30px;
}
.tabrow a {
color: #555;
text-decoration: none;
}
.tabrow li.selected {
background: #FFF;
color: #333;
z-index: 2;
border-top-color: #FFF;
}
.tabrow:before {
position: absolute;
content: " ";
width: 100%;
top: 0;
left: 0;
border-top: 1px solid #AAA;
z-index: 1;
}
.tabrow li:before,
.tabrow li:after {
border: 1px solid #AAA;
position: absolute;
top: -1px;
width: 6px;
height: 6px;
content: " ";
}
.tabrow li:before {
left: -7px;
border-top-right-radius: 6px;
border-width: 1px 1px 0px 0px;
box-shadow: 2px 0px 0 #ECECEC;
}
.tabrow li:after {
right: -7px;
border-top-left-radius: 6px;
border-width: 1px 0px 0px 1px;
box-shadow: -2px 0px 0 #ECECEC;
}
.tabrow li.selected:before {
box-shadow: 2px 0px 0 #FFF;
}
.tabrow li.selected:after {
box-shadow: -2px 0px 0 #FFF;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment