Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to place a fixed div above twitter bootstrap nav menu

I want to place a div above a twitter bootstrap navigation menu, Intro is the div that I want to display above the menu which must be fixed. The issue is I have placed a background image on the menu, but it shows the background image on the Intro div as well, I want to display the background image after the Intro div. Please help me solve this issue.

<div class="navbar navbar-inverse navbar-fixed-top">
<div id="Intro">
 This is page is created with bootstrap
</div>
  <div class="container">
    <div class="navbar-header">
    </div>
  <div class="navbar-collapse collapse">
    <ul class="nav navbar-nav navbar-right">
     <li><a href="home.aspx"> Home</a> </li>
     <li><a href="contact.aspx"> Contact</a> </li>
    </ul>
  </div>
</div>

.navbar-inverse { 
   background-color : #fffff;
   border-color:transparent;
   background: #ffffff;
   url('bgimg.gif') repeat-x;
}
like image 411
user3026519 Avatar asked Feb 06 '14 16:02

user3026519


1 Answers

Move <div id="Intro">above the navbar code:

<div id="Intro">
This is page is created with bootstrap
</div>
<div class="navbar navbar-inverse navbar-fixed-top">

Add some space on top of navbar-fixed:

.navbar-fixed-top {
  top: 20px;

Make this size the height you want for <div id="Intro">

Add additional styling to <div id="Intro">

#Intro {
  top: 0;
  position: fixed;

EDITED: Additional styling for intro div. Add some dimensions and background color to intro div. Try this :

 #Intro {
     top: 0;
     position: fixed;
     background-color: #fff;
     height: 40px;
     width: 100%;

  }
like image 160
moodyjive Avatar answered Sep 24 '22 18:09

moodyjive