Page 262 - Open Soource Technologies 304.indd
P. 262
Web Technologies-I
Notes By replacing “image.gif” with “homepage.gif”, one of my own graphics, you get this...
11.1.1 Here’s What’s Happening: The Image Element Parameters
• IMG stands for “image.” It announces to the browser that an image will go here on the
page. Yes, the image will pop up right where you write in the image tag.
• SRC stands for “source.” This again is an attribute, a command inside a command. It is
telling the browser where to go to find the image. Again, it is best for you to place the
images you want to use in a subdirectory called “images”. This way you can call for the
image by name with just the subdir name in front of it, like this:/images/imagename.gif. You
could also direct the source to some other place online, such as an image you have stored
on Photobucket, for instance, by using the full URL of the image.
• image.gif is the name of the image. Notice it is following the same type of format as your
HTML documents. There is a name (image) then a dot and then there is a suffix (gif).
• ALT stands for “alternate text”. This tells the browser that if it can not find the image,
then just displays this text. It also tells anyone who cannot view your image what the
image is about.
• “some text” is where you put the text describing your image.
• WIDTH stands for just that, the width of the image in pixels. It can range from 1 pixel to,
well, just about any number, but generally will be less than the width of the web browser.
• HEIGHT stands for, as you might guess, the height of the image in pixels. Again, the
height can be just about anything, but generally will be less than the height of the web
browser.
11.1.2 Image Formats for the Web
There are four basic formats you will find on the Web. Each is denoted to the browser by a
different suffix. Remember that “name.suffix”.
• .gif This is pronounced “jif” or “gif” (hard “G”) depending on whom you speak to. “jif”,
like the peanut butter. This is an acronym for Graphics InterchangeFormat.
The format was invented by CompuServe and it is very popular. The reason is that it
is a simple format. It is a series of coloured picture elements, or dots, known as pixels,
that line up to make a picture. Your television’s picture is created much the same way.
Browsers can handle this format quite easily.
• .png Pronounced as ‘ping’, this stands for Portable Network Graphic. This is ultimately
the replacement for .gif, with partial transparency options, but browser support is sketchy
some browsers still do not like to display .png files.
• .jpeg or .jpg (pronounced “j-peg”) there are two names to denote this format because of
the PC and MAC formats allowing 3 and 4 letters after the dot. JPEG is an acronym for
Joint Photographic Experts Group, the organization that invented the format. The format
is unique in that it uses compression after it has been created. That’s fancy computer talk
that means that when the computer is not using a .jpeg image it folds it up and puts it
256 LOVELY PROFESSIONAL UNIVERSITY