Source code: ref/alttext.htp

Table of Contents

<block syntax>
<alttext name="imagename" [ text="imagetext" ]>

<block synopsis>

<strong>ALTTEXT</strong> declares an ALT attribute for any <A
IMG</A> 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
Since this is useful for an image used throughout a set of documents,
ALTTEXT is most appropriate in an <a href="file.html">include file</a> or a
<a href="default.html">default file</A>.
In addition to ALTTEXT, htp can also automatically add WIDTH and HEIGHT
attributes to <A HREF="img.html">IMG</A> tags.


  page source
  htp project
  htp homepage
hosted by
HTML coding Powered by htp
htp on-line reference /
Authors: Jim Nelson, Jochen Hoenicke, Michael Möller.
Maintainers: Jochen Hoenicke.

Copyright © 1995-96 Jim Nelson.
Copyright © 2001-2003 Jochen Hoenicke.
Permission to reproduce and distribute this hypertext document granted according to terms described in the License section.

last updated Tue Feb 22, 2011