- Part 5 - Using Graphics and Colors
- Images need to be saved in appropriate file format:
- GIF (pronounced "jiff")
- JPEG ("jay-peg")
- Create using graphics software
- Scan drawings or photos
- Clip art collections
- Art from the WWW
| JPG Scanned Photo |
GIF Graphic |
Animated GIF |
|
|
|
- HTML tag for images - <IMG>
- Required parameter - SRC to specify file name
To display the file handup.gif, use the following tag:
Here's a sample image
This would be displayed as:
Here's a sample image
The ALIGN parameter can change placement of adjoining text:
Text at the top
Text in middle
Here's what ALIGN does:
Text at the top
Text in middle
SRC may specify relative or absolute references (like HREF):
What?
New!
Those tags would retrieve these images :
What?
New!
- Images may be "hot spots" to create links
- Use anchor tags - <A> </A>
- Place IMG tag between the anchor tags
Use the image handup.gif to link to section of this document named "Top":
Here is the linked image (try clicking it):
Parameter BORDER=0 can be used to eliminate the border:
You may like this better:
Parameter ALT can be used to specify alternate text if browser is not using graphics:
Image files can be used to create a background for web pages:

For a background, use the <BODY> tag at beginning of document (after TITLE tag). The format is:
Image is repeated throughout the document.
Using the <BODY> tag to change the colors in document:
Different codes for background colors:
| FF00FF | FFFF00 | 00FF00 | 00FFFF | 0000FF |
 |  |  |  |  |
Different colors may also be assigned to text and links using the <BODY> tag:
Examples of the <IMG> tag and <BODY> tag:
- <IMG SRC="handup.gif">
- Displays the image in the file handup.gif, which is located in the same directory as the HTML document.
- <IMG SRC="handup.gif" ALIGN=MIDDLE> Text
- Displays the image and aligns the adjoining text in the middle of the image.
- <IMG SRC="http://www.ship.edu/~pfdemp/new.gif">
- An absolute reference to an image file.
- <A HREF="#Top"> <IMG BORDER=0 SRC="handup.gif"> </A>
- Using an image as a link (with no border).
- <A HREF="#Top"> <IMG ALT="Go Up" SRC="handup.gif"> </A>
- The ALT parameter, which displays text for non-graphical browsers (such as Lynx).
- <BODY BACKGROUND="backwhit.gif">
- Using an image as background.
- <BODY BGCOLOR=#FFFFFF>
- Setting the background color to white.
Go to Top of Page
Back to Contents Page
On to Next Section
Web Development Workshop
1999 MSACROA Conference
Sunday, November 28, 1999