Quick Links


Links & Images in HTML

One of the great innovations of HTML was the ability to allow the viewer/user to jump from one page to another by activating predetermined links. This is the origin of the term `H'yper`T'ext. Initially, graphics was not available on the Internet. However, it did not take long for images to not be just displayed but used as links as well. This page will provide the basics regarding how pictures can be displayed and how links can be coded into your documents.

In the following, the `A'nchor tag pair (<A>...</A>) is used for the link (and for the destination if it is in the same document). The href attribute stands for `H'ypertext `REF'erence and name is the label of a document-internal destination.

Links

Links can be made to another document or to a place within a document. In the following, the A tag is used as the `A'nchor for the link (and for the destination if it is in the same document). The href attribute stands for `H'ypertext `REF'erence

  1. In linking to other documents, there are three different methods:

  2. Linking to another point within a document requires two pieces of code, one for the link and the other to label the point being jumped to.

This document-internal link can also be combined with any of the three methods for jumping to another document. This means that you can jump to any predetermined spot in any document. The following code links to the Special Uses section on the Tables page.

<a href=tables.html#nestedtables>Special Uses section</a>

Images

Once graphics was introduced to the Internet, it became possible to not only display pictures and logos of all sorts, but to use the graphics as links.

The `IM'a`G'e tag (<img...>) has no corresponding closer. It does take many attributes, one of which, "src" is obligatory, because without it the browser would not know which image to display. Here is the image produced by
<p><img src=images/pglogo.png></p>

It is possible to produce what is called a runaround by adding an "align" attribute. With a value of "right", the graphic will be placed at the right margin and text will flow around it.

It is possible to produce what is called a runaround by adding an "align" attribute. With a value of "right", the graphic will be placed at the right margin and text will flow around it. Here the text has been justified.

<p><img src=images/pglogo.png align=right>

<p align=justify><img src=images/pglogo.png align=right>

It is also possible to specify the desired size of the graphic, and the browser will scale the picture to the requested height and width as done here with <img src=images/pglogo.png width=24 height=31>. However, as you can see, not all graphics will look as good as when they are rendered at their original size.

It is also possible to cause a graphic to serve as a link. The picture to the right of Hieronymus Megiser is a link to my site for his Dictionarium quatuor linguarum (four-language dictionary). The code to establish this link is
<a href=http://www.dfstermole.net/Megiser/searchmeg6.php><img src=images/megiserst.png align=right></a>


© 2006 DFStermole
Created 13 Mar 2006
Last Modified 8 Aug 2006