Bootstrap Tutorial - Reposition Navbar and links








The following code shows how to reposition Navbar and links.

Example

<!DOCTYPE html>
<html>
<head>
<title>Bootstrap 3 - Center Navbar - jsFiddle demo by KyleMit</title>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-2.0.2.js'></script>
<link rel="stylesheet" type="text/css"
  href="http://netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css"
  href="http://getbootstrap.com/dist/css/bootstrap.css">
<script type='text/javascript'
  src="http://getbootstrap.com/dist/js/bootstrap.js"></script>
<style type='text/css'>
li.trapezoid {<!--  w  w w.ja  va 2s  . c o  m-->
  border-bottom: 50px solid #e7e7e7;
  border-left: 25px solid transparent;
  border-right: 25px solid transparent;
  height: 0;
  width: 100px;
}

li.trapezoid a {
  padding-left: 0;
  padding-right: 0;
  text-align: center;
}
</style>
</head>
<body>
  <div class="navbar navbar-default navbar-fixed-top">
    <div class="container">
      <!-- Header -->
      <div class="navbar-header visible-xs">
        <button type="button" class="navbar-toggle" data-toggle="collapse"
          data-target=".navbar-collapse">
          <span class="icon-bar"></span> <span class="icon-bar"></span> <span
            class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="#">Bootstrap 3.0 Skeleton</a>
      </div>
      <!-- Navbar Links -->
      <div class="collapse navbar-collapse">
        <ul class="nav navbar-nav">
          <li><a href="#Courses">Courses</a></li>
          <li><a href="#About">About Us</a></li>
          <li><a href="#News">News</a></li>
          <li class='trapezoid'><a href="#Home">Home</a></li>
          <li><a href="#Awards">Awards</a></li>
          <li><a href="#Projects">Projects</a></li>
          <li><a href="#Contact">Contact Us</a></li>
        </ul>
      </div>
    </div>
  </div>
  <!-- Post Info -->
  <div
    style='position: fixed; bottom: 0; left: 0; background: lightgray; width: 100%;'>
    About this SO Question: <a
      href='http://stackoverflow.com/q/24457400/1366033'>Repositioning
      Navbar and links</a><br /> Fork This Skeleton Here: <a
      href='http://jsfiddle.net/KyleMit/kcpma/'>Bootstrap 3.0 Skeleton</a><br />
    <div>
</body>
</html>

Click to view the demo