Simple and Stylish tab menu using css

This post helps you to create simple and stylish Horizontal tab menu using pure css without any jquery and scripts. This simple tabbed menu shows like a two horizontal lines with active state of the tabs. In this example i used three navigation  and i spited the 33.33% width of each menu for responsive purpose.

This is one of the best and simple tabs menu  with responsive, I used different colors for active text and detective text in tab menus. This tabmenu is very useful to designers to place the content in different manner in our websites.

Css code for stylish tab menu:

.tabs-stylish {
    max-width: 90%;
    float: none;
    list-style: none;
    padding: 0;
    margin: 75px auto;
   border-bottom: 4px solid #AB4E4E;
}
.tabs-stylish:after {
    content: '';
    display: table;
    clear: both;
}
.tabs-stylish input[type=radio] {
    display:none;
}
.tabs-stylish label {
    display: block;
    float: left;
    width: 33.3333%;
    color: #AB4E4E;
    font-size: 21px;
    font-weight: normal;
    text-decoration: none;
    text-align: center;
    line-height: 2;
    cursor: pointer;
    box-shadow: inset 0 4px #AB4E4E;
    border-bottom: 4px solid #AB4E4E;
    -webkit-transition: all 0.5s;
    transition: all 0.5s;
}
.tabs-stylish label span {
 
}
.tabs-stylish label i {
    padding: 5px;
    margin-right: 0;
}
.tabs-stylish label:hover {
    background: #FFF;
    box-shadow: inset 0 4px #FFC33B;
    border-bottom: 4px solid #FFC33B;
    color: #BF8A28;
}
.tab-content {
    display: none;
    width: 100%;
    float: left;
    padding: 15px;
    box-sizing: border-box;
    background-color:#ffffff;
min-height: 250px;
}

.tab-content * {
    -webkit-animation: scale 0.7s ease-in-out;
    -moz-animation: scale 0.7s ease-in-out;
    animation: scale 0.7s ease-in-out;
}
@keyframes scale {
  0% {
    transform: scale(0.9);
    opacity: 0;
    }
  50% {
    transform: scale(1.01);
    opacity: 0.5;
    }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.tabs-stylish [id^="tab"]:checked + label {
    background: #FFF;
    box-shadow: inset 0 4px #FFC33B;
    border-bottom: 4px solid #FFC33B;
    color: #BF8A28;
}
#tab1:checked ~ #tab-content1,
#tab2:checked ~ #tab-content2,
#tab3:checked ~ #tab-content3 {
    display: block;
}

@media (min-width: 768px) {
    .tabs-stylish i {
        padding: 5px;
        margin-right: 10px;
    }
    .tabs-stylish label span {
        display: inline-block;
    }
    .tabs-stylish {
    margin: 50px auto;
    }
}


Html code for stylish tab menu:

<div class="tabs-stylish">
    <input type="radio" name="tabs-stylish" id="tab1" checked >
    <label for="tab1">
        <span>Tab Menu -1 </span>
    </label>
    <input type="radio" name="tabs-stylish" id="tab2">
    <label for="tab2">
        <span>Tab Menu -2 </span>
    </label>
    <input type="radio" name="tabs-stylish" id="tab3">
    <label for="tab3">
        Tab Menu -3 </span>
    </label>
    <div id="tab-content1" class="tab-content">
        <p>Tab Menu-1 Content goes here.....</p>
    </div>
    <div id="tab-content2" class="tab-content">
        <p>Tab Menu-2 Content goes here.....</p>
    </div>
    <div id="tab-content3" class="tab-content">
        <p>
</div>

Post a Comment

0 Comments