HTML <img> alt Attribute
HTML <img> tag
Example
An image is marked up as follows:
| <img src="angry.gif" alt="Angry face" /> |
Try it yourself »
|
Definition and Usage
The required alt attribute specifies an alternate text for an image, if the image cannot be displayed.
The alt attribute provides alternative information for an image if a user for some reason cannot view
it (because of slow connection, an error in the src attribute, or if the user uses a screen reader).
Note: Internet Explorer displays the value of the alt attribute as a tooltip when mousing over the img element. This is NOT the correct
behavior, according to the HTML specification. All other browsers are following the specification, and will only display the alt text if the image cannot be displayed.
Tip: If you want to create a tooltip for an image, use the title attribute.
Browser Support

The alt attribute is supported in all major browsers.
Syntax
Attribute Values
| Value |
Description |
| text |
An alternate text for an image. Guidelines for the alt text:
- If the image contains information - use alt to describe the image
- If the image is inside an a element - use alt to explain where the link goes
- If the image is only for decoration - use alt=""
|
HTML <img> tag
Stylus Studio® 2010 XML Enterprise Suite raises the bar for productivity in XML development tools.
Millions of XML developers and data integration specialists turn to Stylus Studio's comprehensive and intuitive
XML toolset to tackle today's advanced XML data transformation and aggregation challenges.
|
- XML Pipeline Editor, Debugger and Code Generator
- DataDirect XML Converters
- XQuery Mapper, Editor, Debugger, and Profiler
- XSLT Mapper, Editor, Debugger, Designer, and Profiler
- Java and C# for .Net Code Generation
- XML Schema Designer With Documentation Generator
- XML Editor With Full XPath Integration
Download a free trial now
|
|