Search Engine Marketing Definitions![html img tag <P>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.
<P>To include an inline image, enter:
<P><IMG SRC=<I>ImageName</I>></P>
<P>where <I>ImageName</I> is the URL of the image file.
<P>The syntax for <TT><IMG SRC></TT> URLs is identical to that used in an
anchor <TT>HREF</TT>. If the image file is a GIF file, then the filename part of
<I>ImageName</I> must end with <TT>.gif</TT>. Filenames of X Bitmap images must
end with <TT>.xbm</TT>; JPEG image files must end with <TT>.jpg</TT> or
<TT>.jpeg</TT>; and Portable Network Graphic files must end with <TT>.png</TT>.
<H4 align=left><A name=IS>Image Size Attributes</A></H4>
<P>You should include two other attributes on <TT><IMG></TT> tags to tell
your browser the size of the images it is downloading with the text. The
<TT>HEIGHT</TT> and <TT>WIDTH</TT> 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.)
<P>For example, to include a self portrait image in a file along with the
portrait's dimensions, enter:
<P><IMG SRC=SelfPortrait.gif HEIGHT=100 WIDTH=65></P>
<P><B>NOTE:</B> Some browsers use the <TT>HEIGHT</TT> and <TT>WIDTH</TT>
attributes to stretch or shrink an image to fit into the allotted space when the
image does not exactly match the attribute numbers. Not all browser developers
think stretching/shrinking is a good idea, so don't plan on your readers having
access to this feature. Check your dimensions and use the correct ones.
<H4 align=left><A name=AI>Aligning Images</A></H4>
<P>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.
<P><B>Aligning Text with an Image</B><BR>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 <TT>ALIGN=</TT> attributes
<TT>TOP</TT> and <TT>CENTER</TT>.
<P>This text is aligned with the top of the image (<TT><IMG SRC =
"BarHotlist.gif" ALT="[HOTLIST]" ALIGN=TOP></TT>). Notice how the browser
aligns only one line and then jumps to the bottom of the image for the rest of
the text.
<P>And this text is centered on the image (<TT><IMG SRC = "BarHotlist.gif"
ALT="[HOTLIST]" ALIGN=CENTER></TT>). Again, only one line of text is
centered; the rest is below the image.
<P>
<P><B>Images without Text</B> <BR>To display an image without any associated
text (e.g., your organization's logo), make it a separate paragraph. Use the
paragraph <TT>ALIGN=</TT> attribute to center the image or adjust it to the
right side of the window as shown below:
<P><p ALIGN=CENTER><IMG SRC = "BarHotlist.gif"
ALT="[HOTLIST]"></p></P>
<P>which results in:</P>
<P align=center></P>
<P>The image is centered; this paragraph starts below it and left justified.</P>
<P>
<H4 align=left><A name=AT2>Alternate Text for Images</A></H4>
<P>
<P>Some World Wide Web browsers -- primarily the textonly browsers such as <A
href="http://lynx.browser.org/">Lynx</A> -- cannot display images. Some users
turn off image loading even if their software can display images (especially if
they are using a modem or have a slow connection). HTML provides a mechanism to
tell readers what they are missing on your pages if they can't load images.
<P>The <TT>ALT</TT> attribute lets you specify text to be displayed instead of
an image. For example:
<P><IMG SRC="UpArrow.gif" ALT="Up"></P>
<P>where <TT>UpArrow.gif </TT>is the picture of an upward pointing arrow. With
graphics-capable viewers that have image-loading turned on, you see the up arrow
graphic. With a text-only browser or if image-loading is turned off, the word
<I>Up</I> is shown in your window in place of the image.
<P>You should try to include alternate text for each image you use in your
document, which is a courtesy for your readers -- or, for users who might be
visually impaired, a necessity.
<H4 align=left><A name=IH>Images as Hyperlinks</A></H4>
<P>Inline images can be used as hyperlinks just like plain text. The following
HTML code:
<P><A HREF="hotlist.html"><IMG SRC="BarHotlist.gif"
ALT="[HOTLIST]"></A></P>
<P>Produces the following result:
<P><A href="hotlist.html"></A>
<P>(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:
<P><A HREF="hotlist.html"><IMG SRC="BarHotlist.gif" BORDER=0
ALT="[HOTLIST]"></A></P>
<P>Produces the following result:
<P><A href="hotlist.html"></A>
<P>The BORDER attribute can also be set to nonzero 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:
<P><IMG SRC="BarHotlist.gif" BORDER=6 ALT="[HOTLIST]"></P>](/img/Definition.jpg)
html img tagMost 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.
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=SelfPortrait.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. Not all browser developers
think stretching/shrinking is a good idea, so don't plan on your readers having
access to this feature. Check your dimensions and use the correct ones.
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 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.
This text is aligned with the top of the image (<IMG SRC =
"BarHotlist.gif" ALT="[HOTLIST]" 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.
And this text is centered on the image (<IMG SRC = "BarHotlist.gif"
ALT="[HOTLIST]" 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 = "BarHotlist.gif"
ALT="[HOTLIST]"></p>
which results in:
The image is centered; this paragraph starts below it and left justified.
Some World Wide Web browsers -- primarily the textonly browsers such as Lynx -- cannot display images. Some users
turn off image loading even if their software can display images (especially if
they are using a modem or have a slow connection). HTML provides a mechanism to
tell readers what they are missing on your pages if they can't load images.
The ALT attribute lets you specify text to be displayed instead of
an image. For example:
<IMG SRC="UpArrow.gif" ALT="Up">
where UpArrow.gif is the picture of an upward pointing arrow. With
graphics-capable viewers that have image-loading turned on, you see the up arrow
graphic. With a text-only browser or if image-loading is turned off, the word
Up is shown in your window in place of the image.
You should try to include alternate text for each image you use in your
document, which is a courtesy for your readers -- or, for users who might be
visually impaired, a necessity.
Inline images can be used as hyperlinks just like plain text. The following
HTML code:
<A HREF="hotlist.html"><IMG SRC="BarHotlist.gif"
ALT="[HOTLIST]"></A>
Produces the following result:
(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="hotlist.html"><IMG SRC="BarHotlist.gif" BORDER=0
ALT="[HOTLIST]"></A>
Produces the following result:
The BORDER attribute can also be set to nonzero 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="BarHotlist.gif" BORDER=6 ALT="[HOTLIST]">
See also: http://www.aleksika.com/site-optimization/alt-text
|