HTML09 Create a Web page with appropriate content and insert an image towards the left hand side of the page. When user clicks on the image, it should open another Web page

By | January 12, 2018

Create a Web page with appropriate content and insert an image towards the left hand side of the page. When user clicks on the image, it should open another Web page.

 

Let us take a look at the syntax of the <IMG> tag:

<IMG SRC = “FILENAME.GIF” WIDTH = “value” HEIGHT = “value” ALT =“alternate text” BORDER = “value” ALIGN = “value”>

 

  1. SRC: This attribute specifies the pathname to the source file that contains the image. The value in the above example, “image.gif”, means that the browser will look for the image named image.gif in the same folder (or directory) as the html document itself.
  2. WIDTH: This is used for specifying the desired width of the image.
  3. HEIGHT: This is used for specifying the desired height of the image.
  4. BORDER: An important attribute of the IMG tag is BORDER. This attribute specifies the width of the border of the image. By default it is 0, i.e. there is no border. As shown in Figure 2.9 the image “image.gif” has been given a border 2 pixel wide. The following code gives a wider border to the above image.

 

<BODY BGCOLOUR=”#FFFFFF”><IMG SRC=”image.gif” WIDTH=130 HEIGHT=101 BORDER=10></BODY>

 

  1. ALT: Another IMG attribute that is important is ALT. ALT is sort of a substitute for the image that is displayed or used when the user is using a browser that does not display images. Someone may be using a text only browser, he may have image loading turned off for speed or he may be using a voice browser (a browser where the web page is read out). In those cases, that ALT attribute could be very important to your visitor as it could be used (given the proper text) to describe the image that is not on the screen.

HTML_Image_Link_Source_Code

HTML_Image_Link_Page

 Create a Web page with appropriate content and insert an image towards the left hand side of the page. When user clicks on the image, it should open another Web page.

Html code:

<!DOCTYPE html>
<HTML>
<HEAD>
<TITLE>CSSimplified.com HTML9</TITLE>
</HEAD>
<BODY>
<P ALIGN="left">
<A HREF="test.html">
<IMG BORDER="0" SRC="logo.jpg" WIDTH="250" HEIGHT="100"
ALT = "IMAGE IS TURNED OFF" ALIGN = "BOTTOM" BORDER = 2>
</A>
Please make your valuable suggestions through comments.
</P>
</BODY>
</HTML>

Write above code in any text editor and save by htm or html extension and Open it in any browser by double clicking the file like internetexplorer.

 

<!DOCTYPE html>

This tag defines the document type and HTML version.

 

<HTML>…</HTML>

This tag encloses the complete HTML document and mainly comprises of document header which is represented by <head>…</head> and document body which is represented by <body>…</body> tags.

 

<HEAD>…</HEAD>

This tag represents the document’s header which can keep other HTML tags like <title>, <link> etc.

 

<TITLE>CSSimplified.com HTML 9</TITLE>

The <title> tag is used inside the <head> tag to mention the document title.

 

<BODY>…</BODY>

This tag represents the document’s body which keeps other HTML tags like <h1>, <div>, <p> etc.

 

<PALIGN=”left “>…</P>

The HTML <p> tag defines a paragraph of text.

 

<A HREF=”test.html”>…<A>

The Anchor tag is used to create links between different objects like HTML pages, files, web sites etc. It is introduced by the characters <A> and terminated by </A>. HREF is the most common attribute of the ANCHOR tag. It defines the destination of the link.

<IMG>

The HTML <img> tag is can be used for displaying an image with the desired height and width.

 

The <!DOCTYPE> Declaration

The <!DOCTYPE> declaration tag is used by the web browser to understand the version of the HTML used in the document. Current version of HTML is 5 and it makes use of the following declaration:

<!DOCTYPE html>

There are many other declaration types which can be used in HTML document depending on what version of HTML is being used. We will see more details on this while discussing <!DOCTYPE…> tag along with other HTML tags.

Note:- To understand program for sequence in detail Please SEARCH numerically example: HTML01, HTML02, etc.