Inline Images

Sr.No.
Topics
1

Image Size Attributes

2
Aligning Images
3
Alternate Text for Images
4
Images as Hyperlinks
5
Background Graphics
6
Background Color
7
External Images, Sounds, and Animations

 

Images as Hyperlinks

Inline images can be used as hyperlinks just like plain text. The following HTML code:

    <A HREF="abc.html"><IMG SRC="Underconstruction.gif" ALT="[Underconstruction]"></A>

Produces the following result:

(Note that this link doesn't actually go anywhere.) The blue border that surrounds the image indicates that it's a clickable hyperlink. You may not always want this border to be displayed, though. In this case you can use the BORDER attribute of the IMG tag to make the image appear as normal. Adding the BORDER attribute and setting it to zero:

    <A HREF="abc.html"><IMG SRC="Underconstruction.gif" BORDER=0 ALT="[Underconstruction]"></A>

Produces the following result:

The BORDER attribute can also be set to non-zero values, whether or not the image is used as a hyperlink. In this case, the border will appear using the default text color for the web page. For instance, if you wanted to give your image a plain black border to help it stand out on the page, you might try this:

    <IMG SRC="Underconstruction.gif" BORDER=6 ALT="[Underconstruction]">

And get the following result: