The <img> tag

In HTML and XHTML the img element defines an image. The major difference between HTML and XHTML is in HTML the <img> tag has no end tag:

<img src=”test.gif”>

whereas in XHTML the <img> tag must be properly closed:

<img src=”test.gif” />

I’ve often wondered why the alt attribute text doesn’t show on image mouse-over in the Firefox browser as it does in other browsers.

Actually, Firefox is just using the alt attribute the way it’s meant to be used, like an alternative text if the image won’t load, not as a mouse-over text. It’s only quirky Internet Explorer that incorrectly display the alt [alternative] text on mouse-over.

However, Firefox does support mouse-over comments on images/image maps if you use a title attribute in the <img> tag.

For example: <img src="test.gif" alt="Test" title="Test">

Therefore, if you want a mouse-over comment to appear on an image/image map, make sure you include an alt tag and a title tag to your code.

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

 

Related Posts:
  • No related posts
  •  

    Leave a Reply