Tutorial HTML - Adding Graphics
Images are inserted into a document using the <img>
tag. This is an empty tag.
tag doesn't force a line break, so you can insert an image into
the text line and it will simply appear along with the text.
The SRC (source) attribute is the only required attribute
of the <img> tag.
attribute tells the browser where to find the image that is
to be inserted into your page.
The ALT (alternate) attribute contains a text string that
is displayed when the browser can't display the actual image,
either because it is not a graphical browser or because the
user has turned off image loading.
The string can be up to 1024 bytes long.
Height attribute specifies the height of the image.
Width attribute specifies the width of the image.
The ALIGN of TOP aligns the top of the image with the top
of the tallest item in the current text line.
- The ALIGN value of MIDDLE aligns the middle of the image
with the bottom, or baselione, of the text
or Baseline - The ALIGN value of BOTTOM aligns the bottom
of the image with the bottom, or baseline, of the text.
- The TEXTTOP value for the ALIGN attribute is an extension
to the basic value of TOP. The
TOP alignment aligns the image with the tallest preceding
element anywhere in the line. In
contrast, an alignment value of TEXTTOP aligns the image with
the top of the text, not with the tallest elemnt in the current
- The LEFT value for ALIGN attribute place the image at the
- The RIGHT value for ALIGN attribute place the image at the
Center - Centering an image is to place it within a
to insert a background image?
using color <body bgcolor="3333FF"> as
your background color, you can use an image for the same reason.
just replace the BGCOLOR with BACKGROUND in the
<body> tag to insert a background image as shown below:
a graphic in a web page as you specified. This tag does not
have an ending tag.
a background image in a web page as you specified. Remember
to insert the background image in the <body> tag.
copy these exercise into Notepad and save (Don't forget to put
.html). Then, launch Internet
Explorer and go to File > Open > Browse (find your
saved file). Click OK.
You may use any graphic file to do the exercise. Please make sure
the graphic file is copy into your folder.
Links | Creating Lists and Headings
Reserved © Web Publishing 2003
all my students!
visit this web site regularly.