Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

css to make bootstrap navbar transparent

I use bootstrap and I have a navbar in my html file I would like to make this nav bar transparent to show the background image. Can some one teach me how to do this with css? I tried the following css nothing happend

.navbar-inner {     background-color:transparent; }  <div class="navbar navbar-inverse navbar-fixed-top">             <div class="navbar-inner">                     <div class="container">                         <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">                             <span class="icon-bar"></span>                             <span class="icon-bar"></span>                             <span class="icon-bar"></span>                         </button>                         <a class="brand" href="#">lol</a>                         <div class="nav-collapse collapse">                             <ul class="nav pull-right">                                 <li class="active"><a href="/">Home</a></li>                                 <li><a href="about">About</a></li>                             </ul>                         </div>                     </div>             </div>         </div> 
like image 763
pythoniku Avatar asked May 06 '13 06:05

pythoniku


People also ask

How do you make a navbar transparent in CSS?

The solution is easy. Just set the background-color CSS property to transparent .

How do I make my navbar sticky and transparent?

Here's the solution: Take the navbar and the logo out and place them above all sections. The logo and the navbar together are 256px high. So, apply margin-top: -256px; padding-top: 256px; to the first section and you're done!


2 Answers

Simply add this to your css :-

.navbar-inner {     background:transparent; } 
like image 113
Akshay Paghdar Avatar answered Sep 21 '22 16:09

Akshay Paghdar


What you people are doing is unnecessary.

For transparent background, simply do:

<div class="navbar">  // your navbar content  </div>

without class navbar-default or navbar-inverse.

like image 35
Jochem Stoel Avatar answered Sep 20 '22 16:09

Jochem Stoel