Inline Images

Most Web browsers can display inline images (that is, images next to text) that are in X Bitmap (XBM), GIF, or JPEG format. Other image formats are also being incorporated into Web browsers [e.g., the Portable Network Graphic (PNG) format]. Each image takes additional time to download and slows down the initial display of a document. Carefully select your images and the number of images in a document.

To include an inline image, enter:

    <IMG SRC=ImageName>

where ImageName is the URL of the image file.

The syntax for <IMG SRC> URLs is identical to that used in an anchor HREF. If the image file is a GIF file, then the filename part of ImageName must end with .gif. Filenames of X Bitmap images must end with .xbm; JPEG image files must end with .jpg or .jpeg; and Portable Network Graphic files must end with .png.

Image Size Attributes

You should include two other attributes on <IMG> tags to tell your browser the size of the images it is downloading with the text. The HEIGHT and WIDTH attributes let your browser set aside the appropriate space (in pixels) for the images as it downloads the rest of the file. (You can get the pixel size from your image-processing software, such as Adobe Photoshop. Some browsers will also display the dimensions of an image file in the title bar if the image is viewed by itself without an enclosing HTML document.)

For example, to include a self portrait image in a file along with the portrait's dimensions, enter:

    <IMG SRC=ourpicture.gif HEIGHT=100 WIDTH=65>

NOTE: Some browsers use the HEIGHT and WIDTH attributes to stretch or shrink an image to fit into the allotted space when the image does not exactly match the attribute numbers.

Aligning Images

You have some flexibility when displaying images. You can have images separated from text and aligned to the left or right or centered. Or you can have an image aligned with text. Try several possibilities to see how your information looks best.

Aligning Text with an Image
[GEOCITIES] By default the bottom of an image is aligned with the following text, as shown in this paragraph. You can align images to the top or center of a paragraph using the ALIGN= attributes TOP and CENTER.

[GEOCITIES] This text is aligned with the top of the image (<IMG SRC = "/pictures/gc_icon.gif" ALT="[GEOCITIES]" ALIGN=TOP>). Notice how the browser aligns only one line and then jumps to the bottom of the image for the rest of the text.

[GEOCITIES] And this text is centered on the image (<IMG SRC = "/pictures/gc_icon.gif" ALT="[GEOCITIES]" ALIGN=CENTER>). Again, only one line of text is centered; the rest is below the image.

Images without Text
To display an image without any associated text (e.g., your organization's logo), make it a separate paragraph. Use the paragraph ALIGN= attribute to center the image or adjust it to the right side of the window as shown below:

<p ALIGN=CENTER>
<IMG SRC = "/pictures/gc_icon.gif"  ALT="[GEOCITIES]">
</p>
which results in:

[GEOCITIES]

The image is centered; this paragraph starts below it and left justified.

Images as Hyperlinks

Inline images can be used as hyperlinks just like plain text. The following HTML code:

    <A HREF="geocities.html"><IMG SRC="/pictures/gc_icon.gif"  ALT="[GEOCITIES]"></A>

Produces the following result:

[GEOCITIES]

(Note that this link doesn't actually go anywhere.) The blue border that surrounds the image indicates that it's a clickable hyperlink. You may not always want this border to be displayed, though. In this case you can use the BORDER attribute of the IMG tag to make the image appear as normal. Adding the BORDER attribute and setting it to zero:

    <A HREF="geocities.html"><IMG SRC="/pictures/gc_icon.gif"  BORDER=0 ALT="[GEOCITIES]"></A>

Produces the following result:

[GEOCITIES]

The BORDER attribute can also be set to non-zero values, whether or not the image is used as a hyperlink. In this case, the border will appear using the default text color for the web page. For instance, if you wanted to give your image a plain black border to help it stand out on the page, you might try this:

    <IMG SRC="/pictures/gc_icon.gif" BORDER=6 ALT="[GEOCITIES]">

And get the following result:

[GEOCITIES]

Background Graphics

The tag to include a background image is included in the <BODY> statement as an attribute:

<BODY BACKGROUND="filename.gif">

Background Color

By default browsers display text in black on a gray background. However, you can change both elements if you want. Some HTML authors select a background color and coordinate it with a change in the color of the text.

You change the color of text, links, visited links, and active links (links that are currently being clicked on) using further attributes of the <BODY> tag. For example:

<BODY BGCOLOR="#FFFFFF" TEXT="#OOOOOO" LINK="#9690CC">
This creates a window with a white background (BGCOLOR), black text (TEXT), and silvery hyperlinks (LINK).

To Learn more bakground,visit the site below:

External Images, Sounds, and Animations

You may want to have an image open as a separate document when a user activates a link on either a word or a smaller, inline version of the image included in your document. This is called an external image, and it is useful if you do not wish to slow down the loading of the main document with large inline images.

To include a reference to an external image, enter:

    <A HREF="FruitImage.gif">link anchor</A>
You can also use a smaller image as a link to a larger image. Enter:
     <A HREF="OrangeImage.gif"><IMG SRC="BananaImage.gif"></A>
The reader sees the BananaImage.gif image and clicks on it to open the OrangeImage.gif file.

Use the same syntax for links to external animations and sounds. The only difference is the file extension of the linked file. For example,

<A HREF="AdamsRib.mov">link anchor</A>

specifies a link to a QuickTime movie. Some common file types and their extensions are:

plain text
.txt
HTML document
.html
GIF image
.gif
TIFF image
.tiff
X Bitmap image
.xbm
JPEG image
.jpg or .jpeg
PostScript file
.ps
AIFF sound file
.aiff
AU sound file
.au
WAV sound file
.wav
QuickTime movie
.mov
MPEG movie
.mpeg or .mpg

Keep in mind your intended audience and their access to software. Most UNIX workstations, for instance, cannot view QuickTime movies.

Tables

Table Elements

Element Description
<TABLE> ... </TABLE> defines a table in HTML. If the BORDER attribute is present, your browser displays the table with a border.
<CAPTION> ... </CAPTION> defines the caption for the title of the table. The default position of the title is centered at the top of the table. The attribute ALIGN=BOTTOM can be used to position the caption below the table.
NOTE: Any kind of markup tag can be used in the caption.
<TR> ... </TR> specifies a table row within a table. You may define default attributes for the entire row: ALIGN (LEFT, CENTER, RIGHT) and/or VALIGN (TOP, MIDDLE, BOTTOM). See Table Attributes at the end of this table for more information.
<TH> ... </TH> defines a table header cell. By default the text in this cell is bold and centered. Table header cells may contain other attributes to determine the characteristics of the cell and/or its contents. See Table Attributes at the end of this table for more information.
<TD> ... </TD> defines a table data cell. By default the text in this cell is aligned left and centered vertically. Table data cells may contain other attributes to determine the characteristics of the cell and/or its contents. See Table Attributes at the end of this table for more information.

Table Attributes

NOTE: Attributes defined within <TH> ... </TH> or <TD> ... </TD> cells override the default alignment set in a <TR> ... </TR>.
Attribute Description
ALIGN (LEFT, CENTER, RIGHT) Horizontal alignment of a cell.
VALIGN (TOP, MIDDLE, BOTTOM) Vertical alignment of a cell.
COLSPAN=n The number (n) of columns a cell spans.
ROWSPAN=n The number (n) of rows a cell spans.
NOWRAP Turn off word wrapping within a cell.

General Table Format

The general format of a table looks like this:

<TABLE>
<!-- start of table definition -->

<CAPTION> caption contents </CAPTION>   
<!-- caption definition -->

<TR>  
<!-- start of header row definition -->
    <TH> Mamfe </TH>    
    <TH> Kumba </TH>    
</TR> 
<!-- end of header row definition -->

<TR>  
<!-- start of first row definition -->
    <TD> Limbe </TD>
    <TD> Buea </TD>    
</TR> 
<!-- end of first row definition -->

<TR>  
<!-- start of last row definition -->
    <TD> Ndian </TD>
    <TD> Tiko </TD>    
</TR> 
<!-- end of last row definition -->

</TABLE>
<!-- end of table definition -->

The output will be:
Caption content
Mamfe Kumba
Limbe Buea
Ndian Tiko

Additional Online Resources

I'll advice you to visit the following website and learn more about HTML.

Annabella HTML Guide

NCSA's Beginner's Guide on HTML


















Last Updated on Jume 01st.2002



This page hosted byGEOCITIES Get your own Free Homepage