Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tooltip on anchor's title not shown in IE9

Has something was changed in the way IE9 treats the title attribute in an anchor tag? I try to use a regular anchor, such as -

<a href="http://www.somelink.com" title="Some title here">This is a link</a>

A tooltip should be with the title is expected to appear, and it does appear in previous versions of IE and also in other browsers, but not on IE9. Is there a know issue with that? I tried to search the web for that, but found nothing about this. Any ideas? Thanks

like image 608
Maor Barazany Avatar asked Jul 25 '11 22:07

Maor Barazany


People also ask

How do I hide the title tooltip?

To remove the title tooltips globally, add the following code in the Theme Options > JS: jQuery(document). ready(function($){ $('a'). removeAttr("title"); });

How do I change the tooltip title in CSS?

The tooltip is automatically generated by web browsers, it actually can not be removed or changed. To change the tooltip style, we need to add a tooltip text to a different attribute, for example data-title , then use CSS code to create and customise the style. In WordPress, you can add the CSS code to your theme CSS.

How do you style a title tooltip in HTML?

You can't style an actual title attribute How the text in the title attribute is displayed is defined by the browser and varies from browser to browser. It's not possible for a webpage to apply any style to the tooltip that the browser displays based on the title attribute.

What is tooltip title?

Tooltip is a concept used in HTML for showing some extra information about the specifically selected element. This can be done on the mouse hover effect whenever the user moves the mouse over an element that is using a tooltip to display specified information about that element.


1 Answers

I have encountered this problem in a few applications I've worked on.

I've found it doesn't work if you have nested elements within the element with the title.

The example below doesn't show its title in IE9 for me:

<a href="test.html" title="test tooltip"><span>test link</span></a>

However, this example does work:

<a href="test.html" title="test tooltip">test link</a>

That is with an XHTML 1.0 Transitional doctype and Browser Mode: IE9 and Document Mode: IE9 Standards.

Obviously your example doesn't have a nested element but thought it might be relevant to some people who find this post based on the title.

You can overcome this limitation in IE by specifying the nested element to be an inline-block:

a span {
    display: inline-block;
}
like image 159
Chris Spittles Avatar answered Oct 13 '22 22:10

Chris Spittles