HTML Images : Java Glossary
home H words local find no local find frame, full screen Google search web for topic jump to footer translate with Babelfish 2008-03-30 by Roedy Green ©1996-2008 Canadian Mind Products
Go to : punctuation 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z (all)
HTML Images

Image Techniques

You can either display a *.png, *.gif or *.jpg image reference, or link to it so that you don’t see it unless you click the text link, or you can display an icon or thumbnail, that when you click shows you the big picture:
Ways of Handling Images
Method How it Renders Sample HTML
Displayed
Image
aka inline, embedded
African woman
Text Link
to Image
Click the text link to see an African woman.
Icon Link
to Image
Click the camera icon to see an African woman.click to see photo
Thumbnail Link
to Image
Click thumbnail for a larger image.
click to see photo

Image Displaying

Here is a typical displayed (aka inline or embedded image link:
<!-- display an image --> <img src="../image/people/africanwoman.jpg"
width="200"
height="236"
border="0"
align="top"
alt="African woman"
longdesc="describeafricanwoman.txt">
<!-- usually all on one line -->
Img Tag parameters
Parameter Notes
<img starts an inline embedded image, that displays a picture
src="../image/people/africanwoman.jpg" where to find the jpg, png or gif, possibly an absolute url of the form http://mindprod.com/image/people/africanwoman.jpg
width="200" width of the image in pixels. You may magnify or shrink, but shrinking wastes bandwidth and magnifying generates poor quality images. If you leave it out it the image will render natural size, but will render more slowly.
height="236" width of the image in pixels. You may magnify or shrink, but shrinking wastes bandwidth and magnifying generates poor quality images. If you leave it out it the image will render natural size, but will render more slowly.
align="top" control how the image aligns with the surrounding text. Experiment. You may be surprised. choices are:
Image Alignments
Type Kosher Rendering How Supposed to Render
default demo of default alignmentThe quick brown fox
emailed demo of default alignment!
No special aligning. Inherits the aligning of its surroundings. Don’t key the word default, just leave out the alignment parameter.
absbottom demo of absbottom alignmentThe quick brown fox
emailed demo of absbottom alignment!
Aligns the bottom of the image with the bottom of the current line(including descenders). Not an officially sanctioned value, but it is widely supported.
absmiddle demo of absmiddle alignmentThe quick brown fox
emailed demo of absmiddle alignment!
Aligns the middle of the current line with the middle of the image. Opera aligns with middle of text. IE aligns with middle of any text or other images on the line. Not an officially sanctioned value, but it is widely supported.
baseline demo of baseline alignmentThe quick brown fox
emailed demo of baseline alignment!
Aligns the bottom of the image with the baseline of the current line. Not an officially sanctioned value, but it is widely supported.
bottom demo of bottom alignmentThe quick brown fox
emailed demo of bottom alignment!
Aligns the bottom of the image with the baseline of the current line. This is the same as baseline.
center demo of center alignmentThe quick brown fox
emailed demo of center alignment!
Centred left/right. middle centers up/down. Not an officially sanctioned value, but it is widely supported.
left demo of left alignmentThe quick brown fox
emailed demo of left alignment!
Image will float the image to the left margin (into the next available space there), and subsequent text will wrap around the right hand side of that image.
middle demo of middle alignmentThe quick brown fox
emailed demo of middle alignment!
Aligns the baseline of the current line with the middle of the image.
right demo of right alignmentThe quick brown fox
emailed demo of right alignment!
Will align the image aligns with the right margin, and the text wraps around the left. Note how the images jump out of their usual order of embedding in the text.
top demo of top alignmentThe quick brown fox
emailed demo of top alignment!
Aligns itself with the top of the tallest item in the line.
There are two images, one, a green square 20 points on a side, and one, a png email address image produced by Masker which has a transparent border around it. It is normally aligned using a CSS mailto style to tweak the position.
alt="African Woman" Labels the image. This is not displayed. Sometimes the alt text becomes a tool tip hoverhelp line. Used by blind people to at least know what pictures contain. You may use &entities in the alt, but not <tags.
longdesc="describeafricanwoman.txt" Text file containing a detailed description of the image. Primarily used by the visually impaired.
Note that there is no such img attribute as valign, and align="center" is not officially valid, though most browsers support it. Note the American spelling. Neither is there officially an attribute called align="texttop" or align="textop". Unfortunately, different browsers render these alignments differently. I have found absmiddle works best for inlined images such as email address images.

CMP_homejump to top
CMP logo
feedback Please email your feedback for publication, errors, omissions, broken/redirected link reports
and suggestions to improve this page to Roedy Green : feedback email
made with CSS
HTML Checked!
ICRA ratings logo
mindprod.com IP:[65.110.21.43]
Your face IP:[38.103.63.17] The information on this page is for non-military use only.
You are visitor number 11. Military use includes use by defence contractors.
You can get a fresh copy of this page from: or possibly from your local J: drive (Java virtual drive/Mindprod website mirror)
http://mindprod.com/jgloss/htmlimages.html J:\mindprod\jgloss\htmlimages.html