I need to change the background color of the tool tip which will show on mouse over on a hyperlink (for using in firefox and ie6 & higher). Is there any css and html based scripts (without jQuery or javascript) for doing this.
I came to know that the background color is actually as per the OS properties.
You can use HTML and CSS to create a tooltip of your own style. For this, you would not use a
title
attribute but some content element, which is initially hidden with CSS and becomes visible via a CSS rule with:hover
. There is a large number of pages that explain and illustrate the techniques; Google for css tooltip for example.I do it like this:
No. THe background color is controlled by the browser/OS. You'd need to create a custom tooltip if you want to customize it. And that means javascript in general.
You can't change the colour of a standard tooltip which is declared like:
This is a standard tooltip which has its design chosen by the specific browser and Operating System.
Without using javascript, you could have a hidden div which only appears on hover, however I think this would be messy for anchor links.
I know you have specifically requested no javascript/jquery, but I believe this would be a good solution if you change your mind:
http://flowplayer.org/tools/tooltip/index.html
Here's a technique, by ditching the traditional tooltip altogether and creating your own custom element that displays on
:hover
: http://sixrevisions.com/css/css-only-tooltips/Having wandered around Google for a while I'm pretty sure it's not possible to styling the default
title
tooltip in any browser, so without JavaScript the above technique is your only option.That's controlled by the operating system.