# htp on-line reference : ALTTEXT

## syntax

`<blockdef name="tagname" [option="option1 [option2 ...]" ] [global] [expand]>
... <use block> ...
</blockdef>
`

## synopsis

ALTTEXT declares an ALT attribute for any IMG tag with a SRC matching the ALTTEXT NAME. Since relative paths can be used to point to the same image, only the filename is considered in all comparisons.

When an IMG tag with a matching source is encountered, htp will add an ALT attribute only if one is not already present. This allows for ALT text to be overridden on specific images and default text on all others.

For example:

`<alttext name="logo.gif" text="Company logo">
this line: <img src="logo.gif">
becomes this after processing: <img src="logo.gif" alt="Company logo">
this line: <img src="../image/logo.gif">
will also have an ALT attribute appended to it
this line: <img src="logo.gif" alt="Click here for more information!">
remains unchanged.
`

An ALTTEXT tag with a name but no text attribute removes any ALT mapping for this image. Successing IMG tags with a matching SRC name are not changed.

Since this is useful for an image used throughout a set of documents, ALTTEXT is most appropriate in an include file or a default file.

In addition to ALTTEXT, htp can also automatically add WIDTH and HEIGHT attributes to IMG tags.

hosted by Sourceforge HTML coding

Copyright © 1995–96 Jim Nelson. Copyright © 2001–2014 Jochen Hoenicke. Permission to reproduce and distribute this hypertext document granted according to terms described in the License section. last updated Sat May 16, 2015