Mori Posted September 30, 2009 Share Posted September 30, 2009 Hi, I'd like to put a sentence on my page so that when a user puts their mouse over a certain word, a tooltip appears including some information. I know how to create a linked word with title, but I don't want it to be a link. Also how should I do it for an image. Thanks in advance! Regards Mori Link to comment Share on other sites More sharing options...
Ingolme Posted September 30, 2009 Share Posted September 30, 2009 The title attribute can be placed on anything:<img title="text"><span title="text"><a title="text"> Link to comment Share on other sites More sharing options...
Mori Posted September 30, 2009 Author Share Posted September 30, 2009 I need something very simple. Are the following codes correct: For text: <a title=".....">text</a> For images: <img title="..." src="html://www.example.com/image.jpg" /> Any better suggestions? Link to comment Share on other sites More sharing options...
jlhaslip Posted October 1, 2009 Share Posted October 1, 2009 You should add and Alt-text to the image: <img title="..." alt="..." src="html://www.example.com/image.jpg" /> That will display the alt-text when an image is not available for display. (older) IE uses it as the Title as well. Link to comment Share on other sites More sharing options...
Ingolme Posted October 1, 2009 Share Posted October 1, 2009 I need something very simple. Are the following codes correct: For text: <a title=".....">text</a> For images: <img title="..." src="html://www.example.com/image.jpg" /> Any better suggestions?For text, use the <span> element, not the <a> element. If it's an abbreviation, the <abbr> element is preferrable.<span title=".....">text</span> Link to comment Share on other sites More sharing options...
jlhaslip Posted October 1, 2009 Share Posted October 1, 2009 http://jlhaslip.com/samples/tooltips/index.html Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.