Insert an image in a Web page. Further, apply the border to the image and provide alternate text to it. Now, link the image in the Web page to another document.

Q1. Insert an image in a Web page. Further, apply the border to the image and provide alternate text to it. Now, link the image in the Web page to another document.

Ans. The source code of HTML_Test2.html is shown as follows:

<HTML>

<HEAD>

<TITLE>

Inserting an Image

</TITLE>

</HEAD>

<BODY>

<A HREF=”HTML_Doc.html”> <IMG SRC=”fairy.jpg”

BORDER=2 ALT=”Image is linked”> </A>

</BODY>

</HTML>

 

The source code of HTML_Doc.html is shown as follows:

<HTML>

<HEAD>

<TITLE>

</TITLE>

</HEAD>

<BODY BGCOLOR=”red” TEXT=”white”>

<CENTER> <B> Welcome to HTML </B> </CENTER>

This is the destination page.

</BODY>

</HTML>

The output of the HTML_Test2.html Web page is shown in Figure 1:

Figure 1: Inserting and Linking an Image

The ALT attribute is not supported by Mozilla Firefox; therefore, this Web page is shown in Internet Explorer.

When we click the image, the page is redirected to the Html_Doc. Html page, as shown in the Figure 2:

Figure 2: The Html_Doc.html Page

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: