I was wondering is it possible to give each tooltip a different background color in materialize.css framework?
When the tooltip is activated I don't see any additional markup generated in the inspector, therefore can not target with CSS.
I was wondering is it possible to give each tooltip a different background color in materialize.css framework?
When the tooltip is activated I don't see any additional markup generated in the inspector, therefore can not target with CSS.
I solved it like this
Tooltips appear like this in materialize:
I guess if you figure out the ID of the tooltip you want to change the background of you can do something like this:
#TOOLTIP-ID.backdrop {background-color: red;}
To specify diffrent color for each tooltip you can do it like this:
while initializing tooltips add this function:
and then on your tooltip specify it like this:
as you can see I'm changing the class attribute so you can use materialize-css colors
Tooltip
color can be changed usingcss
. You have to override default css as follow. Assign your color code tobackground-color
inbackdrop
class.Following is sample working code snippet for 4 buttons which show
tooltip
.For current version of materialize.css (1.0.0) you should style .material-tooltip and .tooltip-content
like this (sass):
Updated Answer for 1.0
To style the tooltip's background etc:
To style the actual text within the tooltip use the following: