Raya Deleva’s Web

/ Web development

Problem IMG tag, ALT attribute in FireFox

It was something that I  had never pay attention to... I do not use much the ALT attribute of IMG tag. Most of the cases I used to leave it empty. I believed that it's purpose was to give an description, tooltip ot the image. But this is wrong!

The real purpose of  "ALT" defined by the World Wide Web Consortium is:
For user agents that cannot display images, forms, or applets, this attribute specifies alternate text. The alt attribute must be specified for the IMG and AREA elements. It is optional for the INPUT and APPLET elements.

  • Do not specify irrelevant alternate text when including images intended to format a page, for instance, alt="red ball" would be inappropriate for an image that adds a red ball for decorating a heading or paragraph. In such cases, the alternate text should be the empty string (""). Authors are in any case advised to avoid using images to format pages; style sheets should be used instead.
  • Do not specify meaningless alternate text (e.g., "dummy text"). Not only will this frustrate users, it will slow down user agents that must convert text to speech or braille output.

For a description (tooltip) of an image you have to use the HTML standard attribute title="whatever".

Every HTML tag has own specific attributes, but and Standard Attributes (for all tags with a few exceptions).

Core Attributes

Not valid in base, head, html, meta, param, script, style, and title elements.

AttributeValueDescription
class class_rule or style_rule The class of the element
id id_name A unique id for the element
style style_definition An inline style definition
title tooltip_text  A text to display in a tool tip

Language Attributes

Not valid in base, br, frame, frameset, hr, iframe, param, and script elements.

AttributeValueDescription
dir ltr | rtl Sets the text direction
lang language_code Sets the language code

Keyboard Attributes
AttributeValueDescription
accesskey character Sets a keyboard shortcut to access an element
tabindex number Sets the tab order of an element

visit: www.w3schools.com/tags/ref_standardattributes.asp
category: Web development, posted date: 31.05.2006, Comment

Add your comment here.

Your name*

Your email

Your comments, suggestions, compliments or maybe other?*


What is this blog about? - A blog about sharing wisdoms mostly connected with web development. I truly hope that you will find something useful here. Cheers, Raya.
» About
» Playlist (Social music experiment)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

 Subscribe

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CSS Beauty A List Apart W3schools The best forum for development in Bulgarian CSS Zen Garden Photo Cult PEAR - PHP Extension and Application Repository Rapid development framework for PHP
My lovely friend Bobbyta Awesome! - Mootools Smashing Magazine