WebDevelopersNotes logo

home-icon Home / HTML / Including images in web pages part 2

Including images in web pages part 2

Including images in web pages part 2

HTML NAME attribute for images

You can specify a name for your image through this attribute. This helps in client-side scripting using JavaScript or VBScript.


<IMG SRC="hat.gif" width="150" height="100" name="hat">

HTML ALIGN attribute for aligning images on a web page

This attribute is used to align other HTML elements such as text around the image.

The following will align the image to the right and text to its left.

<IMG SRC="fish.gif" width="160" height="124" align="right">

And the code below will align the image to the left and text to its right.

<IMG SRC="fish.gif" width="160" height="124" align="left">

ALIGN can also take “TOP“, “BOTTOM” or “MIDDLE” as value. These align the text to the top, middle or bottom of the image.

Image VSPACE and HSPACE attributes

These attributes introduce horizontal or vertical space around an image. They take a number as value that determines the number of pixel space created.

The code below will put 30 pixel space on the left and the right side of the image.

<IMG SRC="fish.gif" width="160" height="124"
alt="Fish" hspace="30">

VSPACE accomplishes something similar to HSPACE but adds space to the top and bottom of the image.

HTML LOWSRC image attribute

If you want to load a large high quality image on a page, you should use this attribute to display a low quality image. The low quality image is loaded initially and gives a general idea about the page. The visitor can then decide to wait for the large download. The LOWSRC attribute takes the URL of the low quality image as its value.

Sponsored Links

Your comments
Star icon IMPORTANT Have a question / problem? Click here to ask an expert.

Sponsored Links


How do I view a deleted web page?
Is there a way to view a deleted web page - one that is no longer available? Yes there is and the solution is quite simple. [more...]


It costs between $274 and $361 to manufacture an iPad Air. [more...]

We use cookies to give you the best possible website experience. By using WebDevelopersNotes.com, you agree to our Privacy Policy