Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change Bootstrap 4 tooltip opacity?

What do I need to target to change the opacity for Bootstrap 4? I found that I need to target this to affect its background, but when I add opacity:1 to tooltip-inner or tooltip, it does nothing:

.tooltip .tooltip-inner {
  background-color: #014379;
}

.tooltip .arrow:before {
  border-top-color: #014379;
}

What do I need to do to change it? Thanks!

like image 947
Retros Avatar asked May 04 '18 13:05

Retros


People also ask

How do I style bootstrap 4 tooltip?

To create a tooltip, add the data-toggle="tooltip" attribute to an element. Note: Tooltips must be initialized with jQuery: select the specified element and call the tooltip() method.

How do I change the tooltip style in bootstrap?

You can add different Bootstrap 5 tooltip directions by changing top , right , left , bottom in the data-bs-palcement . By aiming . tooltip-inner and . tooltip-arrow::before , you can change the color.

How do I remove transparency from tooltip?

opacity: 1. 0; filter: alpha(opacity=100);


2 Answers

You can change the opacity of tooltip like this

.tooltip.show {
    opacity: 0.5;
} 
like image 172
Muhammed Albarmavi Avatar answered Oct 02 '22 18:10

Muhammed Albarmavi


If you've tried tried this code

.tooltip.show /* The CSS classes that the tooltip has */ {
    opacity: 0.5; /* or whatever */
}

Then try to add !important, so that you can be sure that your style will be applied

opacity: 0.5 !important;

If it still doesn't work, feel free to tell me.

like image 38
Damiano Magrini Avatar answered Oct 02 '22 20:10

Damiano Magrini