Text displayed on top of tooltip

I'm currently working on implementing tooltips with dynamic content on my website. However, I am facing an issue where the content outside the tooltip is displayed over one of my tooltips.

Check out the Demo here

Here's the code snippet:

/* 
  Looking for a simple yet stylish tooltip?
  Simply copy all [data-tooltip] blocks below:
*/

[data-tooltip] {
  position: relative;
  z-index: 10;
}
... (more code included)
<main>
  <div class="info-wrapper">
    <p>
      <span class="title-question">
        Seeking an animated and user-friendly tooltip solution?
      </span>
      <span>
        Just replicate the CSS declarations under
        <code>[data-tooltip].</code>
      </span>
    </p>
    <p data-tooltip="This is an example of a super long tooltip text that goes over multiple lines. &#xa; &#xa; Note: The tooltip size is dynamically adjusted to the content. However, a minimum and a maximum width are defined." data-tooltip-location="bottom">
      To use the tooltip, simply add the attribute »data-tooltip« with the desired text to an element. P.S. Hover over me to see a long tooltip.
    </p>
    <p data-tooltip="This is an example of a super long tooltip text that goes over multiple lines. &#xa; &#xa; Note: The tooltip size is dynamically adjusted to the content. However, a minimum and a maximum width are defined." data-tooltip-location="top">
      To use the tooltip, simply add the attribute »data-tooltip« with the desired text to an element. P.S. Hover over me to see a long tooltip.
    </p>
  </div>
</main>

Answer №1

Make changes to z-index for [data-tooltip]

Update z-index for

[data-tooltip]:before, [data-tooltip]:after

[data-tooltip] {
  position: relative;
  /*z-index:1; */ /* Delete this line */
}
[data-tooltip]:before,
[data-tooltip]:after {
  z-index:1;
}

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

Google Maps in Angular is not showing up

My Angular Google Maps implementation seems to be working, but unfortunately, the map is not showing on my website. I have confirmed that my JS is loading the maps and I can retrieve the map properties. Interestingly, when I check the Chrome AngularJS Debu ...

Prevent div from moving upward using CSS

Whenever I use the search box, a dropdown list of suggestions appears. However, the searchbox div element keeps moving both up and down. How can I prevent the div from moving upwards? The code snippet below shows a hardcoded unordered list of names for s ...

Tips on activating the overlay solely on the image without affecting the entire column

Currently, I am working on a project locally and do not plan to release it. However, I am facing an issue with making the overlay only appear on the image rather than covering the entire column. I came across some pre-built code on the w3 schools website ...

The res.download() function in Express is failing to deliver the accurate URL to the client

When trying to utilize the res.download() method for downloading specific files from a server, there is an issue where triggering the res.download does not redirect the client to the correct URL. The files intended for download are located in a directory s ...

What is the best way to apply fill to SVG using Tailwind CSS?

I tried using the code provided, but unfortunately, I was unable to Override the fill. The issue seems to have been resolved, but can someone help me achieve this using tailwind CSS? <div className=""> <svg className="text- ...

Having trouble embedding Hangouts button in HTML template using script tags

When I include a Hangouts button on my index page, it is visible and functional as expected: <body ng-app="sampleApp" ng-controller="MainCtrl"> <div class="row"> <div class="col-md-12 m-body"> <div class="m ...

What could be causing the issue preventing me from applying a border in the code below?

There seems to be an issue in the code below where I am struggling to apply a border Can anyone help identify what the problem might be? <!doctype html> <html> <head> <title> My first Navigation Page</title& ...

Using PHP to automatically suggest options when selecting elements from a MySQL table

My project involves creating a basic application for sending confirmation emails. I have a MySQL table that includes 4 columns: id, user_email, user_name, and user_track. The form on the app has a selectbox displaying all the stored user_email entries an ...

What is the best way to build a personalized discussion platform: employing tables, <ul> <li>, <dl> <dt>, or div elements?

Looking to create flexible columns and rows with borders on the left and right of each column. If one row in a column stretches more, the other columns in that row should also stretch accordingly. Came across liquid 2 column layouts and 3 column layouts, b ...

Guide to integrating jssor into an AngularJS application

Struggling to integrate jssor with angularjs, it seems to be failing because jssor is being initialized before angularjs, causing the ng-repeat elements to not resolve correctly. <div id="slider1_container"> <div u="slides"> <!-- Th ...

Can one determine whether an SCSS element is devoid of content?

Can SCSS be used to determine if an element is empty? For instance, I'm interested in assigning a variable based on whether the class has content or not. <div class="defaultClass"> <!-- This div is empty --> </div> Is there a w ...

What is the Best Way to Create a Smooth Border-Bottom Transition?

I'm currently diving into the world of HTML5 and CSS. I want to replicate the layout from . Specifically, I am interested in adding a transition effect to the border bottom of certain elements such as "View Our Listings", "The Agency Daily", "Meet our ...

Click on the anchor tag to reveal additional content beyond the default display

This question stems from a previous discussion on the topic at: Only show specific div with anchor In my profiles.html page, there are profiles of around 20 people all grouped under a class named "profile" and unique ids such as "example-name1", "example ...

Gathering information in the form of a tuple with Selenium in Python

I'm having issues with gathering data as a tuple using Selenium with Python 3.6. The specific page I am trying to extract data from is located at (). My goal is to collect the "manufacturer (maker)" data from the search menu at the top of the page. h ...

Trigger submission issue encountered with Jquery in a dialog (modal) window

It's somewhat difficult for me to fully explain my problem. Nevertheless, I'll give it a go. In my HTML code, I have implemented several triggers using Jquery. Trigger 1 is responsible for validating specific items within a form. Once Trigger 1 ...

creating styles for css elements using equations

I am curious about defining CSS element dimensions before they are rendered without using offset and jQuery. Is it possible to echo PHP into the width/height or position values? For example: <?php $width = 290px; $altwidth = 290; ?> <style> ...

Using the googleapis library within HTML is not permitted

I have been attempting to execute a simple function (uploadFile(test.txt)) within an HTML file, but I am encountering issues as my app.js and Google APIs are not being recognized or called. Node.js is throwing this error: Uncaught ReferenceError: uploadFi ...

Not every image is contained within a DIV element

My current challenge involves wrapping an img element with a div. The issue I am facing is that the image is loading to the left of the div. I have already set the dimensions of the div to match those of the image, but it still loads incorrectly. I've ...

I'm having trouble getting the gutter padding to show up in one specific content block on my Bootstrap webpage. How can I troubleshoot and resolve this

Currently, I am delving into the realm of Bootstrap 5 and have recently put together a simplistic webpage using the row/column structure suggested by Bootstrap. However, while my other columns seem to be cooperating and displaying the gutter padding as exp ...

What is the best way to embed sections of one HTML page into another page?

Is there a method I can use to embed sections of one webpage within another webpage? The dilemma arises from the fact that the second page has a distinct style compared to my main page. Is it feasible to apply the alternate style solely to specific content ...