| [Index of Lessons] [Lesson 6] [Lesson 7] |
6.1. Inline Images |
An inline image is an image that turns up on a web page, for example,
. This world
picture is a GIF file. |
|
| The HTML format for the inline image tag is: |
|
| where filename.gif is the name of a GIF file that resides in the same
directory/folder as your HTML document, Or it can reside in a different
directory but you reference it as though it was in the same directory. By
"inline", this means that a web
browser will display the image in between text. Note how the text immediately follows the world picture above. It is also possible to force the image to appear on a separate line. Simply insert a paragraph tag before the image tag: |
|
| Alignment of Text and Inline Graphics With an attribute to the <img...> tag, you can also control how text adjacent to the image aligns with the picture. The align attribute, added inside the <img> tag, can produce the following effects:
1. align=top<;img align=top src="filename.gif">; This
is a picture of the world.
2. align=bottom(default)<;img align=bottom src="filename.gif">;
This is a picture of the world.
3. align=middle<;img align=middle src="filename.gif">;
This is a picture of the world.
The alt="..." attribute
The HTML for this is :
Height and Width attributes
The format for including this option is: where X is the width of the image and Y is the height of the image in pixels. You can usually use some sort of graphics program or utility to determine these numbers.
Now that you know all of these tags here is the html code used in
loading each of these world pictures you have seen : Of course each picture showing the alignment of the text next to it has that little piece of added code align=...... within each line. Now here's a a little trick for you, I've told you that the width and height of the world pic is 90x90, now with the height and width commands you can change these numbers and your browser will modify the picture for you, in this way you can make the picture smaller, larger or just deform it a little.
Here is the World picture made smaller 30x30: |
| Example As you know, the interesting web sites all have pictures on them, and now that you have looked at enough examples, let's get to work on this web site of ours. The pictures have to be saved in the same directory or folder that you have been saving your page. The pictures used for this web page are here (Pictures). What you should do is use the right mouse button to save the pictures in to the correct directory. There will be step by step instructions on that picture page for you to follow. Once you have done that, add the following to your web page. Or have a web page that contains the following code.
<html>
Like before, add all of this to your first web page by opening the document
and editing the page. To speed it up, you can cut and paste the code. After
you have done all of this, click here (Example
6) to compare your work to the example provided. The page with graphics
is starting to look a little more noticable.
</ul><p>
|
|
| Click on Lesson 7 to continue, or click here (Top) to return to the top of document |