Home   Web Top   Bottom Contents   Prev   Next

Miscellaneous Image Topics

Topics on This Page

Centering an Image
Why doesn't my image show up?
Where Can I Find Images?


Centering an Image

The align attribute of <img> doesn't provide any way to center an image horizontally on the page. To center an image, place it inside either a <center> tag or inside a block tag such as <p> or <h1> and include <align="center"> in that tag. If you include text beside an image, the text together with the image are centered. Here are some examples:

<p align="center">

  <img src="images/bez5a.jpg" width="135" height="135" alt="" />

</p>
<p align="center">

  Some text beside the image
  <img src="images/bez5a.jpg" width="135" height="135" alt=""
       align="middle" />

</p>
<p align="center">

  <img src="images/bez5a.jpg" width="135" height="135" alt="" />
  <br />
  Some text below the image

</p>

Which displays like this:

Some text beside the image


Some text below the image


Why doesn't my image show up?

If your page looks fine on your own computer but some of the images don't show up after you've uploaded the page to your web site, your browser wasn't able to find them. Here's a checklist of things to check:

  1. Did you remember to upload the images?
  2. Did you put them in the proper directory? If you have src="xyz.gif", xyz.gif needs to be in the same directory as your HTML file. If you have src="images/xyz.gif", xyz.gif needs to be in a subdirectory named images, and this subdirectory must be a subdirectory of the one that contains the HTML file.
  3. Are the names correct? Remember to check case sensitivity. WARNING: Sometimes a file name changes to all uppercase when you upload it, and you have to rename it back to the correct case.
  4. Did you upload the images in binary format? Uploading in ascii may cause them to become unusable.
  5. Is the image type supported? All recent browsers support GIF and JPEG images and many support PNG. IE 4+ also supports some additional types such as .bmp. You should avoid using these since other browsers don't support them, and since they're usually larger files than the equivalent gif or jpeg.

Where Can I Find Images?

There are lots of images around that you can use on your web sites. You can find CDs full of images. And there are lots of web sites that offer images that you can use.

Be careful to adhere to any conditions that a site places on their graphics. Some let you use their graphics with no constraints. Others let you use them on personal sites but not on commercial sites. Some want you to include a link to their site if you use their graphics. Some of these want such a link on every page where you've used one or more of their graphics.

It's a good idea to keep track of where all of your images come from. I'd suggest that you use a separate directory for storing images from each site. And use your editor or word processor to create a small note: include the URL where you found the images, plus a list of any constraints on the use of the images.

As a starting point, my bookmarks contain a number of sites under "clip art" (this link opens in a new window).


Home   Web Top   Bottom Contents   Prev   Next