logo
g Text Version
Auto
Beauty & Self
Books & Music
Career
Computers
Education
Family
Food & Wine
Health & Fitness
Hobbies & Crafts
Home & Garden
Money
News & Politics
Relationships
Religion & Spirituality
Society & Culture
Sports
Travel & Leisure
TV & Movies

dailyclick
Bored? Games!
Postcards
Astrology
Take a Quiz
Rate My Photo

new
Jokes & Riddles
Astronomy
Philosophy
Public Health
Canadian Culture


dailyclick
All times in EST

Full Schedule
g
g HTML Site
Elizabeth Connick
BellaOnline's HTML Editor

g

The HTML Image Tag
Guest Author - Diane Cipollo

When the web was first created and people started writing books about how to create websites, placing images on the web didn't get much coverage. This was because of the limitations of the web and the web surfer's computer. But the web and computers have improved considerably and images have become an important part of webpages and websites. The HTML books published today talk about a picture being "worth a thousand words".

Ok, let's say you have your image in the correct format and you are ready to add it to your webpage. You will use the HTML tag called the image tag to do this. Let's take a look at the image tag and its attribute/value parts. Some computer languages do not allow you to break a line of code into two lines such as I have done below. HTML is one of the languages that do allow you to do this.

<img src="images/logo.gif" width="50" height="50"
alt="logo" border="0" hspace="1" vspace="1"
align="left">
Note--The arrow indicates that the code is wrapped to a second line and should really be all on one line.

The first thing you should notice is that the image tag does not have a matching closing tag (</img>) like most HTML tags do. Secondly you can see that this tag has many attribute/value pairs which gives you a lot of control over the way your image is displayed on the web page.

< Left angle bracket
imgElement name
srcThis attribute controls the storage location of the image. It tells the browser where to look for the image.
widthThis attribute tells the browser the width of the image so that it can leave a space for the image.
heightThis attribute tells the browser the height of the image.
altThis attribute gives the image a name (alternate text). When the image cannot be displayed by the web browser for whatever reason, this name will appear inside the designated space.
borderThis attribute controls the thickness of the border that will be placed around the image. There are two default values used if this attribute is not specified in the image tag. A border is used if the image is functioning as a hyperlink (link) button. If the image is just a picture and not a link button, no border appears.
hspaceThis attribute controls the amount of space that is left empty on the right and left side of the image.
vspaceThis attribute controls the amount of space above and below the image.
alignThis attribute controls where the image is placed. The options are top, middle, bottom, left and right.
>Right angle bracket
Next →

|



RSS | Previous Features | Site Map


Content copyright © 2008 by Diane Cipollo. All rights reserved.
This content was written by Diane Cipollo. If you wish to use this content in any manner, you need written permission. Contact Elizabeth Connick for details.

Digg! g delicious Save to Del.icio.us

g


For FREE email updates, subscribe to the HTML Newsletter


Past Issues


print
Printer Friendly
bookmark
Bookmark
tell friend
Tell a Friend
forum
Forum
email
Email Editor

g features
How To Set Up a Mailto Link

Using CSS to Set a Background Image

Choosing the Right Font, Part Two

Archives | Site Map

forum
Forum
email
Contact

Past Issues
memberscenter


vote
Driving Amount
Much more
Slightly more
Slightly less
Much less

g


| About BellaOnline | Privacy Policy | Advertising | Become an Editor |
Website copyright © 2008 Minerva WebWorks LLC. All rights reserved.


BellaOnline Editor