Updating the appearance of tooltips in Bootstrap 4 with custom CSS styles

I am trying to customize the tooltip style by changing the background color to white. I have used the following CSS code:

HTML code:

<th rowspan="2" style="text-align: center">Test <sup><img src="assets/icons/help.png" data-toggle="tooltip" title="test test" data-flow="bottom"></sup></th>

CSS code:

[data-tooltip] {
  position: relative;
  cursor: pointer;
  background-color: #FFFFFF;
  color: #16181b;
  width:100%;
}
[data-tooltip]:before,
[data-tooltip]:after {
  line-height: 1;
  font-size: .9em;
  pointer-events: none;
  position: absolute;
  box-sizing: border-box;
}

However, the changes are not being applied. Can anyone provide guidance on how to fix this?

Current state:

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

Desired outcome:

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

I have managed to change the background color using the following code:

::ng-deep .tooltip-inner {
  width: 700px;
  height: 500px;
  text-align: left;
  background-color: #fff;
  color: #000;
  box-shadow: 0 0 3px #00000040;
}

However, the tooltip is appearing under the border of the cell as shown here: https://i.sstatic.net/cnkHK.png How can I make it appear above the border?

Answer №1

Here is a solution that utilizes the deep selector in Angular:

::ng-deep .tooltip-inner {
  line-height: 20px;
  text-align: left;
  background-color: #fff;
  color: #000;
  box-shadow: 0 0 7px #00000040;
  padding: 15px;
}

::ng-deep.tooltip-arrow {
  top: 0;
  left: 50%;
  margin-left: -5px;
  border-bottom-color: #FFFFFF;
  border-width: 0 5px 5px;
}

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

Differences in wrapping between IE11 and Chrome/Firefox: <DIV>

Take a look at this jsfiddle link using IE 11, Chrome, and FireFox. Here is the HTML code I am working with: <div style="width:120px;background-color:#EE1111;"> <div class="daytext"><b>27</b></div> <div class="dayitem"> ...

Creating overlapping layouts with absolute positioning in Bootstrap leads to a visually appealing

I'm currently working on a layout that involves absolute positioning elements, similar to the one shown in this example: https://i.sstatic.net/TixbZ.jpg It seems like the elements are overlapping and not clearing properly. I've been looking for ...

Display content within DIV element without causing a page refresh

I'm experiencing a small issue with loading addresses in my divs. I have a link that triggers a dialog box and loads the linked address into it, but when I click on the link, the dialog box opens briefly and then everything disappears! Here's w ...

Tips for aligning the navbar logo at the center in Bootstrap 4 when there are navigation links positioned below

I'm having trouble centering the navbar logo with the nav-links below it. I've checked various posts on this issue, but they all seem to be using older versions of bootstrap. I am currently working with bootstrap 4.0. Specifically, I would like ...

Troubleshooting Problem with Bootstrap 4 Navigation Bar Dropdown Feature

I attempted to divide the dropdown menu in the navigation bar into two columns, but they are overlapping with each other. Another issue I noticed is that the Search bar remains at the bottom on mobile devices and the page does not respond properly. I am u ...

Double up on the ul lists for added full-width border effect

My goal is to achieve a design similar to the following image: Here's what I've accomplished so far: <ul class="flechalista"> <li><a href="#">2012</a> <ul class="flechalista"> <li>Enero</li> ...

The class [AdminController] being targeted does not exist

https://i.sstatic.net/r6c7q.pngI encountered an issue where a user is redirected from login to the admin page (e.g. ), and a 403 error should be triggered if the user is not logged in as an admin. Interestingly, even the admin experiences the same error. ...

CSS non-adaptive layout

I am looking to maintain consistency in the appearance of my website across all devices, including PCs, iPads, and Galaxy S4s. I am aware of breakpoints, but I am specifically seeking a solution that does not require me to consider them. Is there a strai ...

When it comes to creating a CSS drop-down menu, don't forget to incorporate an additional <ul

I've created a drop-down menu using CSS with 5 visible list items. When hovering over one of the list items, it highlights and triggers a drop-down effect to display another list underneath. Essentially, you have an initial set of options, and upon ho ...

The AngularJS framework is failing to disable the autocomplete feature for the input field with a password type

I have attempted to disable auto-complete for the password input, but it doesn't seem to be working. Below is a sample of my code: <form name="testfrm" ng-submit="test(testfrm)" autocomplete="off"> <input type="password" id="passwor ...

Translucent overlay enhancing image contrast

Currently, I have a container with a background image that turns semi-transparent on hover. Below is the simplified version of my HTML: <div class="container"> <div class="overlay"></div> <img src="hi.jpg"> </div> This ...

Incorporate a dropdown menu based on the selection made in another dropdown menu

I have a scenario on my website where I want to dynamically add select boxes based on the value selected in the previous one. Here is the code snippet: <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.js"> </script> & ...

Achieving dynamic height in a parent div with a sticky header using mui-datatables

Here are the settings I've configured for my mui-datatables: const options = { responsive: "standard", pagination: false, tableBodyHeight: '80vh', }; return ( <MUIDataTable title={"ACME Employee ...

Contact form script malfunctioning, showing a blank white page

Encountering a white screen when trying to submit my contact form with fields for Name, Email, Subject, and Message. I am looking to receive emails through my website. I have double-checked all variable names and everything seems to be correct. Since I am ...

CSS navigation not working properly in Internet Explorer 7

I am struggling to get this script to function properly in IE 7, as the navigation menu is CSS3-based and breaks completely after using Modernizer. Check out an example on this fiddle Modernizer did not fix the problem, so I'm considering if I need ...

Remove Bootstrap-Table's box-shadow on the search bar's delete button

Is there a way to eliminate the box-shadow from the search box upon clicking on it? I am familiar with removing box-shadows from classes in CSS, but I am unsure of how to remove the box-shadow from a specific property like "data-search" within the tag. ...

Position the vertical bar directly adjacent to the form input field

Looking for assistance with creating a unique webpage layout that includes a form where the employee ID is visually separated from the rest of the content by a vertical bar extending across the entire page. However, my attempts to achieve this using a gr ...

Issues with the alignment of card-footer in Bootstrap 5 card components

Looking to enhance the website for the electronics store I am employed at, I have encountered a challenge while constructing cards using Bootstrap 5. Initially, the cards varied in height until I managed to resolve the issue by setting the card height to 1 ...

Difficulty in pinpointing hyperlinks within a styled list

My current challenge involves customizing the color of links within the <li> elements by applying specific classes to the <li> tag. The structure of my HTML is as follows: <div id="sidebar_tall"> <ul> <li class="active_item"> ...

Setting the variable to global does not apply styling to the element

Looking for help with styling an element created using document.createElement("img")? let fireball; //global variable fireball = document.createElement("img") //variable on local fireballArray.push(someFunction(fireball, { src: "img.png&qu ...