Tutorial: CSS Menu Tabs comment
19.11.14

DEMO//PREVIEW

 The structure of the CSS Menu Tabs is such that it is suitable and definitely one of the many blog structure to opt for when it comes to a minimalistic design. It is clean, simple and above all, it requires CSS and a markup(of course) only. There are plenty of tutorials on Menu Tabs that are coupled with AJAX and jQuery(definitely not in my realm of knowledge in the field of coding). Undeniably, the internet offers tutorials on CSS Menu Tabs alike. But here I am to tutor you on the simplest way(yet) to code CSS Menu Tabs. 

If you want to skip the following(blabber of mine), you might just wanna head straight to here.


The HTML Markup :
<div class="wrapper">
<div id="tabs">
  <ul>
     <input checked id="one" name="tabs" type="radio">
    <label for="one"><a onclick="document.getElementById('tabs-container').innerHTML=document.getElementById('link 1').innerHTML" >Tab 1</a></label>
    <input id="two" name="tabs" type="radio" value="Two">
    <label for="two"><a onclick="document.getElementById('tabs-container').innerHTML=document.getElementById('link 2').innerHTML" >Tab 2</a></label>
    <input id="three" name="tabs" type="radio">
    <label for="three"><a onclick="document.getElementById('tabs-container').innerHTML=document.getElementById('link 3').innerHTML" >Tab 3</a></label>
    <input id="four" name="tabs" type="radio">
    <label for="four"><a onclick="document.getElementById('tabs-container').innerHTML=document.getElementById('link 4').innerHTML" >Tab 4</a></label>
    <input id="five" name="tabs" type="radio">
    <label for="five"><a onclick="document.getElementById('tabs-container').innerHTML=document.getElementById('link 5').innerHTML" >Tab 5</a></label>
  </ul>
  </div>
    <div id="tabs-container"><br>
      <center><h1>Css Menu Tabs</h1>
        <h2>by<a href="/"> evangelista</a></h2>
      </center>
  </div>

</div>
  <div id="link 1" style="display:none;">
<div class="content"><center><h1>Css Menu Tabs</h1>
        <h2>by<a href="http://evangelista-grace.blogspot.com/"> evangelista</a></h2>
      </center>
      </div></div>
<div id="link 2" style="display:none;">
<div class="content"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur mutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit litterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur parum clari, fiant sollemnes in futurum
      </div></div>
<div id="link 3" style="display:none;">
<div class="content"> esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur mutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit litterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur parum clari, fiant sollemnes in futurum
      </div></div>

<div id="link 3" style="display:none;">
<div class="content"> ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur mutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit litterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur parum clari, fiant sollemnes in futurum
      </div></div>
<div id="link 4" style="display:none;">
<div class="content">Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam
      </div></div>
<div id="link 5" style="display:none;">
<div class="content"> ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum. Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur mutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit litterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur parum clari, fiant sollemnes in futurum
      </div></div>

The CSS :
@import url(http://fonts.googleapis.com/css?family=Lobster|Nunito);
.wrapper{
    position: absolute;
    top: 10%;left:10%;
 
}
#tabs-container{
width:512px;min-height:200px;padding:15px;border:4px solid grey;position:absolute;top:25px;z-index:-50;}
#tabs ul{
     clear:left;
   float:left;
   list-style:none;
   margin:0;
   padding:0;
   position:relative;
   l
   text-align:center;color:grey
}

.content{
color:black; float:center; text-align:justify; width:492px;height:200px;padding:2px; overflow:auto;background:#fff;padding-right:10px;
}

h1{
  font-family: 'Lobster', cursive;font-size:40px;color:grey;
}
h2{
  font-family:nunito;font-size:20px;color:#ccc;
}
h2 a{
  text-decoration:none; color:#ccc;
}
input {
    opacity: 0;
}
label {
    display:inline;border: 5px solid grey;cursor:crosshair;
width:100px;
height:20px;
  font-family:nunito;font-size:15px;color:#aaa;letter-spacing:2px;text-align:center;text-decoration:none; list-style:none; display:inline; float:left; margin-right:0px; border-top-right-radius:50px;border-top-left-radius:10px;border-bottom:4px solid grey;z-index:999999999;background: #efefef;
background:-moz-linear-gradient(top, #efefef, #ffffff);
background:-webkit-linear-gradient(top, #efefef, #ffffff);
background:-o-linear-gradient(top, #efefef, #ffffff);
background:-ms-linear-gradient(top, #efefef, #ffffff);
background:linear-gradient(top, #efefef, #ffffff);
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#efefef', endColorstr='#ffffff',GradientType=0);
}
label:hover {
    background: -webkit-linear-gradient(#ffffff, #fefefe,#eeeeee,#dedede,#ddd,#ccc;);
}
input:checked + label {
background:#fff;

    color: #333;border-bottom:4px white solid;z-index:999999999;
}
Paste the following code after the tag <head>
The important code :
<script type="text/javascript">
function changeNavigation(id)
{document.getElementById('tabs-container').innerHTML=document.getElementById(id).innerHTML}
</script>

* Your panel's/content's/page/etc's ID///important to note/// 

*Play around with the codes and you'll understand it better. You'll even be able to customize/edit the CSS tags and their respective HTML tags once you are able to grasp it all ;)


Labels: , ,