HTP

Source code: ref/alttext.htp

Table of Contents
  htp.def
  macros.def
  htp.htt



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

<block synopsis>

<strong>ALTTEXT</strong> declares an ALT attribute for any <A
HREF="img.html">
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.
<p>
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.
<p>
For example:

<htpcode>
  <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.
</htpcode>

<p> 
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.
<p>
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>.
<p>
In addition to ALTTEXT, htp can also automatically add WIDTH and HEIGHT
attributes to <A HREF="img.html">IMG</A> tags.

</block>

  page source
  htp project
  htp homepage
hosted by
SourceForge.net
HTML coding Powered by htp
htp on-line reference / http://htp.sourceforge.net/ref/
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