Hover over thumbnail for more information

I'm in the process of setting up our forum and have already implemented a verification system. However, I'm interested in creating a tooltip similar to the one on Facebook. When you hover over the check image, text will appear.

I've tried various methods to achieve this but haven't had any success.

Check out GoDaddy's Facebook Page for reference

HTML

The img tag should look like this:

data="BroHosting confirmed that this profile is authentic for individuals, media, brands, or companies." class="tip"

CSS/Styling

img:hover {
  color: red;
  position: relative;
}

img[data]:hover:after {
  content: attr(data);
  padding: 4px 8px;
  color: rgba(0,0,0,0.5);
  position: absolute;
  left: 0;
  top: 100%;
  white-space: nowrap;
  z-index: 2;
  border-radius: 5px ;
  background: rgba(0,0,0,0.5);
}

Any suggestions for fixing this issue or alternative ideas are greatly appreciated!

Answer №1

.custom-box {
  position: relative;
  display: inline-block;
  background-color: #5890ff;
  width: 12px;
  height: 12px;
  border-radius: 100%;
  color: #000;
  text-decoration: none;
}
.custom-box:after {
  content: attr(data-tooltip);
  position: absolute;
  top: 0;
  left: 14px;
  width: 100px;
  background-color: #000;
  color: #FFF;
  font-family: Arial, sans-serif;
  font-size: 14px;
  padding: 5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease-in-out;
  will-change: opacity;
}

.custom-box:hover:after {
  opacity: 1;
  pointer-events: auto;
}
<a href="#" class="custom-box" data-tooltip="Lorem ipsum dolor sit amet"></a>

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

How to refresh the page when pausing the YouTube iframe API

I'm encountering an issue with my code where I am trying to refresh the page when exiting or pausing full screen mode. Exiting full screen is working as expected, however, pausing using the YouTube iframe API's "onstatechange" event does not seem ...

The silent button malfunctioning - Ionic

Within the html file: <video preload="metadata" muted="true" controls playsinline webkit-playsinline loop> Despite the "muted" tag, the video is playing with sound in both the browser and on the device. After referencing the video and setting the ...

CSS - Resizing Images

I am experiencing an issue with the width of an image on my website. I want it to span 100% of the browser frame, but it is currently limited to only 1000px wide. Please take a look at: The image in question is located at the top of the page. Is there a ...

What's the issue with the addClass function not working as expected?

I am currently integrating the website's navbar using PHP, which is why I am unable to use class="active" to highlight the active tab on my navigation bar individually. To solve this issue, I attempted to add the active class to the corresponding tab ...

Incorporate a Font Awesome icon into a Bootstrap 4 callout

I am having issues adding an icon to the left side of a Bootstrap 4 callout. Currently, the icon is appearing above the H4 heading. I would like the icon to be positioned on the left side before the message. I have attempted using .p:last-child but it doe ...

Changing innerHTML with HTML generated by a PHP function? (utilizing xajax)

I have managed to successfully update the content inside a DIV using xajax when clicking a link. However, I noticed that it only works when I directly assign HTML within the function itself, not when calling it from another function. Allow me to demonstra ...

Can someone suggest a more efficient method to extract information from my HTML data?

Currently, I am populating list boxes and other elements by appending HTML. I retrieve PHP data from a JSON file using AJAX, which gives me more flexibility in terms of reloading elements on the page and reducing unnecessary page loads. function tracker_l ...

Utilize JavaScript to send an email containing a link and content

In the html form, there are input fields for adding a new user to the database. Once a user is added, an email is sent to them using the sendmail() function in the adduser.js file. The email is sent successfully according to my standards. However, I want t ...

Why is the child element appearing on top of another element even though it has a lower

Today, I decided to dive into z-index and experiment with it. However, I am having trouble understanding the behavior. Below is a simplified version of the HTML structure: // content has z-index of 30, pos abs <div class="content"> // content-c ...

programming selenium to interact with a specific element on a webpage

I need to automate the process of opening a specific page and clicking on the performance button using Python. from selenium import webdriver import time browser = webdriver.Chrome('../Downloads/chromedriver.exe') browser.get('https://www. ...

Remove the highlighting from a web element using Selenium

Is there a way to remove the highlight from a web element that was previously highlighted using Selenium with Java programming language? The border of the element was highlighted using the JavascriptExecutor as shown below: JavascriptExecutor js=(Javasc ...

What is the best way to manage a download link that necessitates an Authorization token when using Angular?

I'm currently working with a REST API in combination with Angular. The issue I'm facing is related to post objects that include file attachments. Every time a user wants to download a file attachment, they must make a call to /get/file/{id}, but ...

What is the best way to display items within a table using React?

I'm just starting to learn React. Can someone show me how to use the "map" function to list elements from two different arrays in two columns? state = { dates: ["2000", "2001", "2002"], cases: ["1", "2", "3"] } render() { return ( <thea ...

What steps should I take to design and implement this basic search form?

Essentially, I have a three-page setup: - One page containing all possible search results such as: 'search result 1' 'search result 2' 'search result 3' - Another page with a search form and enter button. - And finally, a res ...

Utilizing Ajax to update the login form without reloading the page and displaying any errors

I have created a login form that utilizes ajax to handle login errors such as "incorrect password" from my login.php file. Instead of reloading a new page with the error message, it now displays the errors on the same login form, which is working perfectly ...

Issues with playing Html 5 video arise when making an ajax call

My goal is to implement an AJAX call followed by displaying an HTML5 video. The provided code snippet seems to be ineffective. $.ajax({ type: "POST", url: "Videos.aspx/GetBlocs", contentType: "application/json; charse ...

Ways to prevent the hover state from activating when the mouse is in the corner of a circular QPushButton

I'm working on customizing a QPushButton that has round corners: https://i.stack.imgur.com/g8zfs.png When the mouse hovers over the button, I want to change its style: https://i.stack.imgur.com/SDm79.png To achieve this, I utilized setStyleSheet f ...

What is the process of attaching a CSS class to jQuery variables?

Welcome everyone! I am relatively new to CSS and jQuery. In my project, I'm using different CSS classes based on certain conditions within a loop. if(get_node_details[i]['node_status'] == "ONLINE") { var panel_color = ".panel panel-prim ...

Incorporating a stationary sidebar onto your website

My goal is to create a fixed side menu similar to the one on this website: Below is my HTML code: <!-- Scroll TEST --> <ul id="followTab"> <li> <a class="newsletter" href="newsletter/" title="Subscribe to ..."> ...

programming for the final radio button text entry

I am struggling with a form that has 5 radio buttons, including an "other" option where users can manually enter text. The issue I'm facing is that the form only returns the manual entry text and not any of the preset radio values. I need it to work f ...