Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use Bootstrap Tooltips with image links?

I'm struggling to use Bootstrap tooltips with image links. The problem is that when the img tag is inside the a tag, the tooltip doesn't display at the correct spot and seems to flicker. When inspecting the HTML, the actual a tag is beneath the image altogether. Here's a fiddle: http://jsfiddle.net/paniwani/DUPyR/248/

like image 975
paniwani Avatar asked Feb 20 '12 02:02

paniwani


People also ask

How to create tooltips in Bootstrap framework?

By using the Tooltip.js plugin of Bootstrap framework, you may create tooltips for different elements like buttons, links, text boxes etc. quite easily. I will show you how to create simple and customized tooltips with online examples in this tutorial. You may click on any image or link below the image for seeing the live demos.

How do I add a tooltip to a hyperlink?

To create a tooltip, you need to add the data-bs-toggle="tooltip" attribute to an element. Tolltip text that would display on hover can be specified using the title attribute. Here is the standard markup for adding a tolltip to a hyperlink.

How do I create a tooltip using jQuery?

To create a tooltip, add the data-toggle="tooltip" attribute to an element. Use the title attribute to specify the text that should be displayed inside the tooltip: <a href="#" data-toggle="tooltip" title="Hooray!"> Hover over me </a> Note: Tooltips must be initialized with jQuery: select the specified element and call the tooltip () method.

What is the tooltip plugin?

The Tooltip plugin is small pop-up box that appears when the user moves the mouse pointer over an element:


1 Answers

This works:

a { display: inline-block; }

http://jsfiddle.net/DUPyR/249/

like image 155
elclanrs Avatar answered Oct 21 '22 11:10

elclanrs