Adding unique designs to ngbtooltip in Angular

I am trying to customize the style of my tooltip just like in the image above.

https://i.sstatic.net/RbQyL.png

Your assistance is much appreciated..
Thank you!

Answer №1

If you want to give your tooltip a custom style, you can use the "tooltipClass" attribute and define a style for the new class.

<button type="button" ngbTooltip="Click here for more info" tooltipClass="custom-tooltip">
  <img src="info_icon.png">
</button>
.custom-tooltip .tooltip-inner {
   background-color: #ffcc00;
}

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

Answer №2

To resolve the issue, I made use of the tooltipClass attribute and incorporated some custom CSS code:

::ng-deep .my-custom-class .tooltip-inner {
    background-color: #ffffff;
}

::ng-deep .my-custom-class .tooltip-arrow::before {
    border-bottom-color: #ffffff;
}

Note: Make sure to include ::ng-deep before each of your CSS selectors.

Answer №3

At long last, the solution is in my hands. This is the key to achieving the desired outcome

<a class="btn mr-5" ngbTooltip="Upload new files" tooltipClass="custom-tooltip" placement="bottom">
   <img src="/assets/images/upload-files-btn.png" />
</a>

.custom-tooltip .tooltip-inner {
  background: #59ADFF !important;
  padding: 10px;
  font-size: 14px !important;
  position: absolute;
  right: 5px;
  width: 300px;
}

.custom-tooltip .arrow::before {
  border-bottom-color: #59ADFF !important;
}

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to arrange divs in Bootstrap 4?

Is there a way to reorder two divs that are next to each other in a row on mobile? I want the right side div (col-md-9) to be displayed first. I attempted using flex ordering, but unfortunately it caused layout issues throughout my site. <div class="r ...

Can object-fit be preserved while applying a CSS transform?

Currently, I am developing a component that involves transitioning an image from a specific starting position and scale to an end position and scale in order to fill the screen. This transition is achieved through a CSS transform animation on translate and ...

My fixed navigation bar is being impacted by the link decorations

I'm fairly new to web development, so please be patient with me. I am trying to achieve a design where my image links are displayed at half opacity by default and then switch to full opacity when hovered over. While this is working as intended, it see ...

Having difficulties with IE11 embedded font not functioning properly despite attempting all standard solutions

I'm having a slight issue with my embedded fonts. They seem to be working perfectly in Firefox, Chrome, and Safari, but unfortunately not in Internet Explorer (tried versions 11 and 10). I've managed to get some fonts to load in IE, but others ju ...

Creating multiple versions of a website based on the user's location can be achieved by implementing geotargeting techniques

It may be a bit challenging to convey this idea clearly. I am interested in creating distinct home pages based on the source from which visitors arrive. For instance, if they come from FaceBook, I envision a tailored home page for FaceBook users. If they ...

What could be causing the partial transparency in my SVG mask?

I have been working on an interesting SVG code that creates a rectangle with a cutout circle. However, I am facing an issue where the non-cutout part appears to be partially transparent. https://i.sstatic.net/1PLHL.gif Can anyone provide me with guidance ...

I'm having trouble getting my modal to open, it just displays the information on my page instead

I am encountering some difficulties with my model window. I would like it to open a modal that shows a larger version of the photo and description when the thumbnail is clicked. However, I have not been able to get it to work properly. The only time it pop ...

Concealing unnecessary borders on list elements using jQuery

Here is the code I am working with: http://jsfiddle.net/eLyJA/ I am looking to calculate and eliminate all border edges to achieve this visual effect: ...

What is the optimal method for increasing the height of an image up to its maximum height?

I have a unique container designed to showcase images with a fixed width of 100%. Here are my specific requirements: The image must maintain its original aspect ratio. If the image is wider, the width should be 100% and the height less than the designate ...

What steps can I take to ensure that the full tingle modal, which includes an image, is visible when the

Upon loading the page, I noticed that if the browser width is greater than 540px, the modal displaying an image gets cut off (see figure below). What steps should I take to ensure that the vertical scroll bar appears immediately? https://i.sstatic.net/cJv ...

Interactive search tool for toggling visibility of elements

Hello everyone, this is my initial post on StackOverflow. Keeping my fingers crossed that it goes smoothly! <input type="Text" id="filterTextBox" placeholder="Filter by name"/> <script type="text/javascript" src="/resources/events.js"></scr ...

Safari experiencing issues running Svg animations

We are currently developing a web application using React with SVG animations. While our SVG animations work perfectly on desktop and Android browsers, they do not animate on iOS devices (specifically tested on Safari on iPhone 5s, 8, and MacBook Pro). ...

Non-jQuery UI option for creating an accordion widget

I successfully implemented a jQuery accordion feature in my project, which allows for "open accordion based on current URL" and "highlighted current articles". Initially, everything was working fine. However, I encountered an issue when adding two additio ...

Alpha 6 Vertical Carousel in Bootstrap 4 - Take Your Website to New

Trying to create a carousel oriented vertically in Bootstrap 4 Alpha 6 has been a bit of a challenge. It's puzzling why the Bootstrap developers didn't include this orientation, but I've been working on my own solution. I suspect there' ...

Loading background images in CSS before Nivo slider starts causing a problem

I've been struggling with preloading the background image of my wrapper before the nivo-slider slideshow loads. Despite it being just a fraction of a second delay, my client is quite particular about it -_- After attempting various jQuery and CSS tec ...

Enhance your iPad's design with a stylish div box-shadow

I'm in the process of developing a touch-optimized web application. As part of the design concept, I've implemented some visually appealing div elements that respond to clicks or touches for easy navigation. While this functionality works perfec ...

Tips for integrating scroll-snap and jQuery's .scroll() function together

I'm facing challenges in integrating both of these elements into the same project. When I activate overflow: scroll, my jQuery function does not work as expected. However, if I deactivate it, then the jQuery works but the scroll-snap feature does not ...

The Clash of Backdrop Modals and Dropdown Menus

Looking for a solution to ensure that the datetimepicker stays in place when a user scrolls, even after opening the Modal backdrop with the "Open" button? The challenge lies in maintaining the position fixed for the modal while preventing the datetimepic ...

What is the method for switching between active tabs?

Do you mean an accordion navigation that opens on the first click and closes on the second click? If you want to see a demo, here is the link: http://codepen.io/cowardguy/pen/dGKEjy You can check out the above link for a visual reference. $("ul.otel-fil ...

I'm facing a problem with the margin and display setup in my assignment

I am encountering a bit of confusion regarding the margin when implementing the following code: Section { background-color: #FFFFFF; width="100%"; } p1 { font-family: Roboto; font-size: 22px; font-height: 1px; margin-top: 45px; margin-lef ...