Can I change the opacity of the navigation bar in twitter bootstrap?

I came across this site : and began to think. Is this possible with twitter bootstrap ? I do not see the opacity parameter in the css file? It is as simple as adding it.

+5
source share
3 answers

In general, it is possible. Testflightapp uses an background-color: rgbaopacity attribute .

So, if you want to set the background color with opacity to your element, use this CSS:

elementname {
    background-color: rgba(128, 128, 128, 0.5); /* Red [0-255], Green [0-255], Blue [0-255], Alpha [0-1] */
}

If you want to set the opacity of the element as a whole, use:

elementname {
    opacity: 0.5; /* opacity [0-1] */
    -moz-opacity: 0.5; /* opacity [0-1] */
    -webkit-opacity: 0.5; /* opacity [0-1] */
}

This is only supported by browsers that support CSS3.

+18
source

, , - .

bootstrap , css , .

selector {
    .opacity(50);   /* opacity [0->100]  */
}

, IE .

+8

If you are using bootstrap with sass. You can use a mixture of opacity.

@include opacity([from 0-100]);

This will result in the compatibility of all compatible browsers (if supported) regarding opacity.

+3
source

All Articles