Inside
DHTML
Home | Community | Developer's Paradise
Online Tours | Site Information
 Main Menu
 Image Tag Wizard
-Image Tag Wizard
-Discuss this Article

<Advertisement>

Inside Technique : Image Tag Wizard
By Scott Isaacs

When adding images to your web page you should always specify the width and height attributes. These attributes help improve the performance of your page.

To determine the size of the image you can use a graphics package or you can use a short DHTML script. We have found the script solution quicker and more convenient than firing up our graphics software. We used to use the following script to quickly retrieve the size of an image (IE4+ only):


<IMG SRC="image path" 

     ONCLICK="alert(this.width+':'+this.height)">

We started using this script so often that we decided to create a simple wizard that you can use to automate this task. This wizard automatically determines the width and height of your image and generates HTML that can be pasted directly into your web-page. This simple wizard runs in Netscape Navigator 3.0+ and Internet Explorer 4.0+. Your images are processed entirely on your machine and are not submitted to our server.

Note: In Netscape, if the image is from your local machine, be sure to prefix your image URL with "file:///D|/" where D is your drive letter.

Image SRC Url:
Alt Text
Generated <IMG> HTML
Discuss and Rate this Article

Go to Home Page Go Back One Page

Return to home menu