Tab Header

1. Decide on the Navigational Elements and Colours

It is initially important to decide on which tabs you will want to place on your site, and what the colour scheme will be. You need to have an idea of how many tabs there will be, and what the default background and rollover background colour will be. Make a note of these!

2. How It Works

The tab area is set as a layer, to hover over a specific part of the page – you set this manually, based on where you would like it to be located.

Simply take the CSS code (see below), and change the commented values to fit in with the colour scheme of your website. You can go deeper and change elements such as the height, width and position of the menu bar if you want.

3. Download the CSS Code

Download a copy of the CSS code, then link to it as explained below.

4. Insert the CSS file into your HTML Code

Upload the tabsample.css file to your server, then place the following line in your area to link to the stylesheet.

5. Place the Tabs in your HTML Code

OK, so you’ve got all the formatting done for tabs in the CSS file, now you just need to place the correct HTML code in your index.php page.

For each tab you want to display, enter:

For each different tab, change the following:

"home" – this is a one word description of the page (for the reason why, see below)
"/index.php" – this is the link to that particular page
"The Weblog" – a description of the page you’re linking to
Blog – the word you want to appear in your navigation bar as a link

Note: It doesn’t really matter where you place this source code, as the position they appear in is set in the CSS file. I would recommend somewhere near the header area.

6. What’s the PHP for?

The PHP code in the above line allows you to have an alternative look and feel for the tab on the current page (see the ‘Blog’ tab above?) Simply place this line underneath the tag of each page of your website:</p> <p></p><!-- Crayon Syntax Highlighter v_2.7.2_beta --> <link rel="stylesheet" type="text/css" href="https://designshack.net/wp-content/plugins/crayon-syntax-highlighter/themes/solarized-light/solarized-light.css" /> <link rel="stylesheet" type="text/css" href="https://designshack.net/wp-content/plugins/crayon-syntax-highlighter/fonts/monaco.css" /> <div id="crayon-5c1646d33cca3515248765" class="crayon-syntax crayon-theme-solarized-light crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" style=" margin-top: 12px; margin-bottom: 12px; font-size: 13px !important; line-height: 20px !important;"> <div class="crayon-plain-wrap"><textarea wrap="soft" class="crayon-plain print-no" data-settings="dblclick" readonly style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 13px !important; line-height: 20px !important;"> <?php $page="home"; ?></textarea></div> <div class="crayon-main" style=""> <table class="crayon-table"> <tr class="crayon-row"> <td class="crayon-nums " data-settings="show"> <div class="crayon-nums-content" style="font-size: 13px !important; line-height: 20px !important;"><div class="crayon-num" data-line="crayon-5c1646d33cca3515248765-1">1</div></div> </td> <td class="crayon-code"><div class="crayon-pre" style="font-size: 13px !important; line-height: 20px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;"><div class="crayon-line" id="crayon-5c1646d33cca3515248765-1"><span class="crayon-ta"><?php</span><span class="crayon-h"> </span><span class="crayon-v">$page</span><span class="crayon-o">=</span><span class="crayon-s">"home"</span><span class="crayon-sy">;</span><span class="crayon-h"> </span><span class="crayon-ta">?></span></div></div></td> </tr> </table> </div> </div> <!-- [Format Time: 0.0001 seconds] --> <p></p> <p>As before, change <code>"home"</code> section to match that on the tab area.</p> <p>If you do not want to use this functionality or are not using PHP in your pages, replace the code in Step 5 with the following:</p> <p></p><!-- Crayon Syntax Highlighter v_2.7.2_beta --> <link rel="stylesheet" type="text/css" href="https://designshack.net/wp-content/plugins/crayon-syntax-highlighter/themes/solarized-light/solarized-light.css" /> <link rel="stylesheet" type="text/css" href="https://designshack.net/wp-content/plugins/crayon-syntax-highlighter/fonts/monaco.css" /> <div id="crayon-5c1646d33cca7340475691" class="crayon-syntax crayon-theme-solarized-light crayon-font-monaco crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouseover" style=" margin-top: 12px; margin-bottom: 12px; font-size: 13px !important; line-height: 20px !important;"> <div class="crayon-plain-wrap"><textarea wrap="soft" class="crayon-plain print-no" data-settings="dblclick" readonly style="-moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4; font-size: 13px !important; line-height: 20px !important;"> <li><a href="/index.php" title="The Weblog">Blog</a></li></textarea></div> <div class="crayon-main" style=""> <table class="crayon-table"> <tr class="crayon-row"> <td class="crayon-nums " data-settings="show"> <div class="crayon-nums-content" style="font-size: 13px !important; line-height: 20px !important;"><div class="crayon-num" data-line="crayon-5c1646d33cca7340475691-1">1</div></div> </td> <td class="crayon-code"><div class="crayon-pre" style="font-size: 13px !important; line-height: 20px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;"><div class="crayon-line" id="crayon-5c1646d33cca7340475691-1"><span class="crayon-o"><</span><span class="crayon-v">li</span><span class="crayon-o">></span><span class="crayon-o"><</span><span class="crayon-i">a</span><span class="crayon-h"> </span><span class="crayon-v">href</span><span class="crayon-o">=</span><span class="crayon-s">"/index.php"</span><span class="crayon-h"> </span><span class="crayon-v">title</span><span class="crayon-o">=</span><span class="crayon-s">"The Weblog"</span><span class="crayon-o">></span><span class="crayon-v">Blog</span><span class="crayon-o"><</span><span class="crayon-o">/</span><span class="crayon-v">a</span><span class="crayon-o">></span><span class="crayon-o"><</span><span class="crayon-o">/</span><span class="crayon-v">li</span><span class="crayon-o">></span></div></div></td> </tr> </table> </div> </div> <!-- [Format Time: 0.0001 seconds] --> <p></p> <p>You should end up with a menu looking similar to the one at the top of this page in no time. It’s a simple method, and spices up your pages navigation!</p> <div class="content-ad-728"> <!-- /111737822/Below_Article --> <div id='div-gpt-ad-1500475375974-0' style='height:90px; width:728px;'> <script> googletag.cmd.push(function() { googletag.display('div-gpt-ad-1500475375974-0'); }); </script> </div> </div> </div> </article> </div><div class="fourcol last right-column"> <div class="sidebar-box newsletter"> <h3>Become a Member</h3> <p>Join our 30,000+ members to submit your designs, collect inspiration, and more.</p> <form action="/membership/join/" method="post"> <input type="hidden" value="" name="email" /> <input type="text" value="Email Address" name="l2ADb2kaDB22" id="l2ADb2kaDB22" class="placeholder" aria-label="Email Address"> <div class="newsletter-privacy-checkbox" style="display:none;"> <input type="checkbox" name="newsletter" value="y" style="-webkit-appearance:checkbox; float:left; margin: 5px 10px 10px 0;"> <p style="margin: 5px 0 5px;">Subscribe to newsletter + promos</p> </div> <input type="submit" value="Join Now →"> </form> </div> <div class="sidebar-box newsletter newsletter-privacy"> <p>If you subscribe, we will use your email address to send one newsletter every week, and occasional promotions from us and our partners.</p><br /> <p>By clicking, you agree that we may process your information in accordance with our <a href="https://designshack.net/privacy/">privacy policy</a>.</p> </div> <div class="sidebar-box darker"> <div class="ad-300250"> <!-- /111737822/Premium_Sidebar --> <div id='div-gpt-ad-1500475375974-3' style='height:250px; width:300px;'> <script> googletag.cmd.push(function() { googletag.display('div-gpt-ad-1500475375974-3'); }); </script> </div> </div> </div> <div class="sidebar-box darker" style="text-align: center;"> <!-- /111737822/Tall_Sidebar --> <div id='div-gpt-ad-1505731337658-0' style='height:600px; width:300px;'> <script> googletag.cmd.push(function() { googletag.display('div-gpt-ad-1505731337658-0'); }); </script> </div> </div> </div> <div class="fourcol last right-column"> <div class="sidebar-box about-author"> <div class="author-archive-intro"> <h5>About the Author</h5> <div class="author-archive-profileimage"><img src="/images/author/1.jpg" alt="David Appleyard" /></div> <h3><a href="https://designshack.net/author/davidappleyard/">David Appleyard</a></h3> <p><a href="https://davidappleyard.net">David Appleyard</a> helps to build fun things for the design community, including <a href="https://designshack.net">Design Shack</a>, <a href="https://creativevip.net">Creative VIP</a>, and <a href="https://themelantic.com">Themelantic</a>.</p><br /> <a href="http://twitter.com/davidappleyard" class="icon-twitter" title="Twitter"></a> <a href="https://plus.google.com/108120757686210234798?rel=author" class="icon-googleplus" title="Google+"></a> <a href="http://dribbble.com/davidappleyard" class="icon-dribbble" title="Dribbble"></a> </div> </div> </div> </div> </div> <footer class="container footer"> <div class="row"> <div class="col copyright"> <p><a href="https://compactcreative.com">Made by Compact Creative © 2018</a></p> <p class="footer-social"> <a href="https://twitter.com/designshack" class="icon-twitter" title="@designshack on Twitter"><span>@designshack on Twitter</span></a> <a href="https://facebook.com/designshack" class="icon-facebook" title="Facebook"><span>Facebook</span></a> <a href="https://www.pinterest.com/designshack/" class="icon-pinterest" title="Pinterest"><span>Pinterest</span></a> <a href="https://plus.google.com/+designshack?rel=publisher" class="icon-googleplus" title="Google+"><span>Google+</span></a> <a href="http://feedpress.me/designshack" class="icon-rss" title="RSS Feed"><span>RSS Feed</span></a> </p> </div> <nav class="col footer-nav"> <p><strong><a href="https://designshack.net" title="Design Shack">Home</a></strong> / <strong><a href="https://designshack.net/category/articles/" title="Design Articles & Tutorials">Articles</a></strong> / <strong><a href="https://designshack.net/features/" title="Design Features">Features</a></strong> / <strong><a href="https://designshack.net/gallery/" title="Design Gallery">Gallery</a></strong></p> <p><a href="https://designshack.net/about/" title="About Design Shack">About</a> / <a href="https://designshack.net/membership/" title="Design Shack Advertising">Membership</a> / <a href="https://designshack.net/advertising/" title="Design Shack Advertising">Advertising & Sponsorship</a> / <a href="https://designshack.net/privacy/" title="Privacy Policy">Privacy</a> </nav> <div class="col mediatemple last"> <a class="siteground-link" href="https://www.siteground.com/index.htm?afcode=2d47fb9cdbcdde4febce905b72f4b736"><span>In Partnership with</span></a> </div> </div> </footer> <!-- Load Typekit --> <script src="https://use.typekit.net/mfs7ifq.js"></script> <script>try{Typekit.load({ });}catch(e){}</script> <script src="//ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script type="text/javascript" src="/js/designshack.min.js"></script> <script> $( "#l2ADb2kaDB22" ).focusin(function() { $( ".newsletter-privacy" ).slideDown( 200 ); $( ".newsletter-privacy-checkbox" ).slideDown( 200 ); }); </script> <script type="text/javascript" src="/js/lazyloading.js"></script> <script> // lazy loading lozad(".lazy-load", { rootMargin: "800px 0px", loaded: function (el) { el.classList.add("is-loaded"); } }).observe() // read next recommendations $(document).scroll(function() { var y = $(this).scrollTop(); if (y > 1400) { $('.read-next').fadeIn(); } else { $('.read-next').fadeOut(); } }); </script> <script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-2121991-2', 'auto'); ga('send', 'pageview'); </script> <link rel='stylesheet' id='crayon-css' href='https://designshack.net/wp-content/plugins/crayon-syntax-highlighter/css/min/crayon.min.css?ver=_2.7.2_beta' type='text/css' media='all' /> <script type='text/javascript'> /* <![CDATA[ */ var CrayonSyntaxSettings = {"version":"_2.7.2_beta","is_admin":"0","ajaxurl":"https:\/\/designshack.net\/wp-admin\/admin-ajax.php","prefix":"crayon-","setting":"crayon-setting","selected":"crayon-setting-selected","changed":"crayon-setting-changed","special":"crayon-setting-special","orig_value":"data-orig-value","debug":""}; var CrayonSyntaxStrings = {"copy":"Press %s to Copy, %s to Paste","minimize":"Click To Expand Code"}; /* ]]> */ </script> <script type='text/javascript' src='https://designshack.net/wp-content/plugins/crayon-syntax-highlighter/js/min/crayon.min.js?ver=_2.7.2_beta'></script> <script src="//m.servedby-buysellads.com/monetization.js" type="text/javascript"></script> <script> (function() { if (typeof _bsa !== 'undefined' && _bsa) { _bsa.init('stickybox', 'CKYDLK3I', 'placement:designshacknet'); } })(); </script> </body> </html> <!-- Performance optimized by W3 Total Cache. Learn more: https://www.w3-edge.com/products/ Database Caching using disk (Request-wide modification query) Served from: designshack.net @ 2018-12-16 12:36:35 by W3 Total Cache -->