Creating a Web Page VII.5: Images

0 Conversations

Please refer to previous entries in the "Creating a Web Page" series:

I know, I know: I forgot an entry, OK?

Along with color, images are an integral part of webpages. You can download them from databases, scan them in, take pictures with a digital camera and load them directly into your computer through it, or create art directly on the computer. Images come in many different formats. GIF is one of the most common, used for cartoons or other pictures with few colors and sharp lines. JPEG is often used for scans of photographs. There are many others (TIFF, PNG, etc) that each have their advantages and drawbacks. When you put in the filename of your image in the tag, be sure to include the extension- the dot and the three letters that come after it, and to pay attention to capital letters. This tells the browser what type of image it's about to display. If you don't include the extension and don't type it exactly the same in the HTML as it appears in the file name, the browser won't be able to find the image in your files.

Sample HTML:

<IMG WIDTH=144 HEIGHT=99 BORDER=0 SRC="DONTPANIC.GIF" ALT="Don't Panic!">

Result:

Don't Panic!








The width and height of the image are in pixels. You can find out the size of an image by opening it in something like Photoeditor or Photoshop. Many download databases will also give you the dimensions with the description of it. ALT stands for "alternate text". If the image doesn't load correctly for some reason, or if your viewer prefers to surf with images off to save time, the text will show up instead. It's not absolutely necessary but it's a good backup to have.

If you want text to flow around an image, there are a few more attributes you can add.

HSPACE and VSPACE are how much space to leave around the image, horizontally and vertically. ALIGN can be TOP, CENTER, or BOTTOM. This is how the text lines up with the image. Due to the limits of GuideML, I cannot demonstrate these attributes but I can demonstrate alignment:

Sample HTML:

<IMG WIDTH=144 HEIGHT=99 BORDER=0 ALIGN="LEFT" SRC="DONTPANIC.GIF" ALT="Don't Panic!">

Don't Panic!







<IMG WIDTH=144 HEIGHT=99 BORDER=0 ALIGN="CENTER" SRC="DONTPANIC.GIF" ALT="Don't Panic!">

Don't Panic!







<IMG WIDTH=144 HEIGHT=99 BORDER=0 ALIGN="RIGHT" SRC="DONTPANIC.GIF" ALT="Don't Panic!">

Don't Panic!








Bookmark on your Personal Space


Conversations About This Entry

There are no Conversations for this Entry

Entry

A682607

Infinite Improbability Drive

Infinite Improbability Drive

Read a random Edited Entry


Written and Edited by

Disclaimer

h2g2 is created by h2g2's users, who are members of the public. The views expressed are theirs and unless specifically stated are not those of the Not Panicking Ltd. Unlike Edited Entries, Entries have not been checked by an Editor. If you consider any Entry to be in breach of the site's House Rules, please register a complaint. For any other comments, please visit the Feedback page.

Write an Entry

"The Hitchhiker's Guide to the Galaxy is a wholly remarkable book. It has been compiled and recompiled many times and under many different editorships. It contains contributions from countless numbers of travellers and researchers."

Write an entry
Read more