Search code examples
angulartooltipprimeng

how to style primeng tooltip


I had tried by giving custom class & tool tip Style Class to the tooltip it does not work for this

1


Solution

  • HTML

       <button
                    pButton 
                    type="button" 
                    class="p-button-raised p-button-rounded p-button-success"
                    label="Tooltip Button" 
                    pTooltip="Hello World !" 
                    tooltipPosition="bottom">
       </button>
    

    CSS

    .p-tooltip .p-tooltip-text {
        background-color: grey !important;
        color: green !important;
    }
    

    or better to use :host ::ng-deep without important

    :host ::ng-deep .p-tooltip .p-tooltip-text {
        background-color: grey;
        color: green;
    }