I would like to use tooltip in a web page with the following constraints:
- Tooltip should work with simple texts, not only with anchors.
- I do not want to use javascript, only css.
- I would like to make it work at least in Firefox and Internet Explorer.
A promising candidate is Eric Meyer’s solution, but it uses anchors. Loadaveragezero’s solution uses span for simple text, but it does not work in Internet Explorer.
I am looking for a working code sample or a link to a solution with the above parameters.
As others have said, your requirements are unrealistic. In environments where Javascript may be disabled, I typically will use the
titleattribute to get simple browser tooltips as a fallback, and then enable better looking tooltips via Javascript reading the title attributes (using a framework such as jQuery, or for my personal preference Mootools).Code sample might be something like (using Mootools and the Tips addon):