Reader Level:

Creating Navbar in PHP

By Vinod Kumar on Mar 25, 2013
In this article I explain use of a navbar in PHP in a Twitter bootstrap.


In this article I explain use of a navbar in PHP in a Twitter bootstrap. I will use a Twitter Bootstrap to create a static Navbar. I will use a HTML page with content and see how to add a top in a page navigation bar into it and in this article I have used a jquery.js and bootstrap-dropdown.js file. Both files are present in the "twitter-bootstrap-v2/docs/assets/js" folder. You can download this folder from this link: I explain this in this article using HTML5.




<meta charset="utf-8">  

<title>Twitter Bootstrap navbar</title>   

<link href="twitter-bootstrap/twitter-bootstrap-v2/docs/assets/css/bootstrap.css" rel="stylesheet">  

<style type="text/css"> 


padding: 10px




<div id="fb-root"></div> 

<script>(function (d, s, id) {

    var js, fjs = d.getElementsByTagName(s)[0];

    if (d.getElementById(id)) return;

    js = d.createElement(s); = id;

    js.src = "//";

    fjs.parentNode.insertBefore(js, fjs);

}(document, 'script', 'facebook-jssdk'));</script> 

<div class="navbar navbar-fixed-top"> 

  <div class="navbar-inner"> 

    <div class="container"> 

    <ul class="nav"> 

  <li class="active"> 

    <a class="brand" href="#">c-sharp</a> 


  <li><a href="#">Home</a></li> 

  <li><a href="#">About</a></li> 

  <li><a href="#">Contact</a></li> 


<ul class="nav"> 

  <li class="dropdown"> 

    <a href="#" 




          <b class="caret"></b> 


    <ul class="dropdown-menu"> 

     <li><a href="#">Web Design</a></li> 

  <li><a href="#">Web development</a></li> 

  <li><a href="#">Theme development</a></li> 




<form class="navbar-search pull-left"> 

  <input type="text" class="search-query" placeholder="Search"> 


<ul class="nav pull-right"> 

  <li class="dropdown"> 

    <a href="#" 




          <b class="caret"></b> 


   <ul class="dropdown-menu"> 

     <li class="socials"> 

<g:plusone annotation="inline" width="150"></g:plusone>


  <li class="socials"><div class="fb-like" data-send="true" data-width="150" data-show-faces="true"></div></li> 

  <li class="socials"><a href="" class="twitter-share-button">Tweet</a> 

<script>!function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (!d.getElementById(id)) { js = d.createElement(s); = id; js.src = "//"; fjs.parentNode.insertBefore(js, fjs); } }(document, "script", "twitter-wjs");</script></li>







<script src="twitter-bootstrap-v2/docs/assets/js/jquery.js"></script> 

<script src="twitter-bootstrap-v2/docs/assets/js/bootstrap-dropdown.js"></script> 

<script type="text/javascript">

    (function () {

        var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;

        po.src = '';

        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);






You will see our services, as in the following:

twitter bootstrap1.jpg

And you will see our social site, as in the following:

twitter bootstrap2.jpg

Vinod  Kumar
Vinod Kumar

       Hi every one I am MCA qualified from IGNOU, Currently working as a Senior software Engineer at dogSpot pvt ltd gurgaon having 3+ year experience and also like web designing ... Read more