We add an image to a web page using the <img> tag. This tag has a number of extra parameters associated with it to further define the presentation of the image on our web page. These parameters are detailed in the table below.
| Tag |
Options |
Description |
| hspace |
|
Defines the size of the margin on either side of the image |
| vspace |
|
Defines the size of the margin on above and below the image |
| src |
|
The source image file. This may either be relative, for example /images/balloon.gif, or absolute http://www.mywebsite.co.uk/images/balloon.gif. |
| alt |
|
The alternative text for this image. This should be defined for compatability of the website to text only browsers such as Linx or braille website browsers. It is also recommened for search engine indexing. |
| border |
|
The size of the border around the image. If the |
| width |
|
The width of the image. It is good practice to size the image to its final dimensions |
| height |
|
The height of the image. |
| align |
top |
The image is presented with a single line of text alongside it, to the right, aligned with the top of the image |
|
texttop |
This is similar to the top align option. The true result tends to be browser dependant. In some browsers the image aligned with the top of the tallest text item. |
|
bottom |
As with the top option there is a single line of text to the right of the image. The text is level with the bottom of the image. this is usually the written line, however, some browsers will render the lowest part of the text level with the bottom of the image. |
|
absbottom |
Like the bottom option there is a single line of text, level with the bottom of the image |
|
middle |
Similar to the other alignment options given above there is a single line of text to the right of the imge. This line of text is level with the middle of the image. In some browsers the bottom of the written line will be level with the middle of the image. |
|
absmiddle |
A single line of text is level with the middle of the image. No ambiguity regarding the middle of the text and the image middle. |
|
baseline |
The written line on the piece of text is aligned with the bottom of the image. There is no ambiguity as there is with the bottom alignment. |
|
left |
The image is positioned to the left of the text. Multiple lines of text are presented to the right of the image, flowing onto the next line underneath the image. |
|
right |
Similar to the left option, but the image is to be found on the right with the text on the left. |
| border |
|
The size of the border around the image. If the |
| usemap |
|
Used to indicate that the image has a map definition associated with it. To use a map definition the image should be named. The map definition should preceed the iamge definition and reference the image name. |
NAT November 2005
| |
This article viewed: 1827 times |
Back |
Copyright © 2004-2008 Janet Systems Ltd.