Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Transparent color of Bootstrap-3 Navbar

I'm having problem with setting bootstrap3 navbar transparency or opacity color. I didin't change anything in bootstrap.css or bootstrap-theme.css In my menu I'm Trying to put image under that and set color to black-transparent or black with opacity like here: http://i.imgur.com/f9NNwtD.png You can see that opacity ammount is not very high but it is , and i have to do something like that. When I'm changing anything the color is setting white so please help me.

The Code below:

<div class="navbar transparent navbar-inverse navbar-static-top hr">
    <div class="navbar-brand logo"></div>
    <div class="navbar-brand-right">
    </div>
    <div class="container">

        <div class="navbar-header">
            <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>

        </div>
        <div class="navbar-collapse collapse">
            <ul class="nav navbar-nav mineul" style="font-size:17px;margin-top:9px; color:white;">
              <li><a href="#">Test1</a></li>
               <li><a href="#">Test1</a></li>
               <li><a href="#">Test1</a></li>
            </ul>

        </div>
    </div>
</div>

And bootply: http://bootply.com/106966

like image 426
woj_jas Avatar asked Jan 19 '14 15:01

woj_jas


People also ask

How do I make the navigation bar background transparent?

Creating a transparent navbar is very easy - just don't add a color class . bg-* to the navbar. In this case, the Navbar will take the color of the parent's background color.

How do you make a NavBar transparent in CSS?

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

Is there a transparent color in CSS?

The CSS color name transparent creates a completely transparent color. Using rgba or hsla color functions, that allow you to add the alpha channel (opacity) to the rgb and hsl functions. Their alpha values range from 0 - 1.

How do you make a NavBar react transparent?

to the const NavBarContainer lets say. Then pass const { useTransparent } = props; to the NavBar function/class component using props and then add useTransparent to the NavBar in the HomePage too. Show activity on this post. background-color: rgba(0,0,0,0.0) will work.


3 Answers

.navbar {
   background-color: transparent;
   background: transparent;
   border-color: transparent;
}

.navbar li { color: #000 } 

http://bootply.com/106969

like image 124
Sinan Gül Avatar answered Oct 16 '22 07:10

Sinan Gül


you can use this for your css , mainly use css3 rgba as your background in order to control the opacity and use a background fallback for older browser , either using a solid color or a transparent .png image.

.navbar {
   background:rgba(0,0,0,0.5);   /* for latest browsers */
   background: #000;  /* fallback for older browsers */
}

More info: http://css-tricks.com/rgba-browser-support/

like image 30
arnold Avatar answered Oct 16 '22 08:10

arnold


The class is .navbar-default. You need to create a class on your custom css .navbar-default.And follow the css code. Also if you don’t want box-shadow on your menu, you can put on the same class.

 .navbar-default {
      background-color:transparent !important;
      border-color:transparent;
      background-image:none;
      box-shadow:none;  
 }

enter image description here

To change font navbar color, the class is to change – .navbar-default .navbar-nav>li>a see the code bellow:

  .navbar-default .navbar-nav>li>a {
     font-size:20px; 
     color:#fff; 
 }

ref : http://twitterbootstrap.org/bootstrap-navbar-background-color-transparent/

like image 3
Mujahidul Jahid Avatar answered Oct 16 '22 08:10

Mujahidul Jahid