Wednesday, December 30, 2009

How do i make that little tag caption thing when you mouse over an image?

i want to have a little bubble pop up when someone mouses over an image saying what the image is...is there any way to do this using html? thanks for your help?How do i make that little tag caption thing when you mouse over an image?
The alt=';'; IS NOT the CORRECT attribute to use for a mouseover. IE gets it WRONG and always has since it does not follow web standards. Use:





title=';Mouseover Description';





That can be used on pretty much ANY tag and will give you the pop up tool tip in all compliant browsers. The actual code:





%26lt;p%26gt;%26lt;img style=';width: XXpx; height: YYpx; border: 0;'; src=';Path to image'; title=';Mouseover Description'; alt=';Text Description';%26gt;%26lt;/p%26gt;





You can change the ';p'; tags to div tags and style as needed to make a nice div container for links.





RonHow do i make that little tag caption thing when you mouse over an image?
You mean like a Tooltip? Use title.


Here's an example -


%26lt;html%26gt;


%26lt;body%26gt;





%26lt;img src=';angry.gif'; title=';your pop up text goes here'; alt=';Angry face'; width=';32'; height=';32'; /%26gt;





%26lt;/body%26gt;


%26lt;/html%26gt;








Hope this helps. Let me know if you have any queries. Have fun :)
%26lt;img src=';someImage.jpg'; alt=';Whatever you want the tag to say';/%26gt;





^^ HTML way


You can make it fancier if you use JavaScript
  • treatments
  • No comments:

    Post a Comment