The <IMG> tag places an inline image to the Web page.

The src attribute of the <IMG src=imageURL> tag refers to the location of the image file. This image file can be on the same Web hosting computer or somewhere else on the Internet. Both absolute and relative URL can be used for imageURL. (See Hyperlinks and URLs)

Click here to review how the following document appears in a Web browser.

<HTML>
<HEAD>
<TITLE>Enter the Page Title Here</TITLE>
</HEAD>
<BODY>
<IMG src="images/csk_badge.gif"> Chan Sui Ki (La Salle) College, which was founded in 1969, is one of the five Lasallian secondary schools in Hong Kong. The motto of our school in Latin is LAUS DEO SEMPER, which actually means 'Praise be to God always'. English has been used as the medium of instruction in our school since its establishment in 1969. Approval to continue using English as the medium of instruction was granted by the Education Department in January, 1998.
</BODY>
</HTML>

Note that the image appears within (i.e., inline) the text.

 

The align attribute of the <IMG align=value src=imageURL> tag determines how text and images align with each other on a Web page.

The value of the align attribute can be "top", "middle", "bottom", "left", or "right".

Click here to review how the following document appears in a Web browser.

<HTML>
<HEAD>
<TITLE>Enter the Page Title Here</title>
</HEAD>
<BODY>
<P>Default Setting<BR><IMG src="images/csk_badge.gif"> Chan Sui Ki (La Salle) College, which was founded in 1969, is one of the five Lasallian secondary schools in Hong Kong. The motto of our school in Latin is LAUS DEO SEMPER, which actually means 'Praise be to God always'. English has been used as the medium of instruction in our school since its establishment in 1969. Approval to continue using English as the medium of instruction was granted by the Education Department in January, 1998.</P>
<P>Align=Top<BR><IMG align="top" src="images/csk_badge.gif"> Chan Sui Ki (La Salle) College, which was founded in 1969, is one of the five Lasallian secondary schools in Hong Kong. The motto of our school in Latin is LAUS DEO SEMPER, which actually means 'Praise be to God always'. English has been used as the medium of instruction in our school since its establishment in 1969. Approval to continue using English as the medium of instruction was granted by the Education Department in January, 1998.</P>
<Pp>Align=Middle<BR><IMG align="middle" src="images/csk_badge.gif"> Chan Sui Ki (La Salle) College, which was founded in 1969, is one of the five Lasallian secondary schools in Hong Kong. The motto of our school in Latin is LAUS DEO SEMPER, which actually means 'Praise be to God always'. English has been used as the medium of instruction in our school since its establishment in 1969. Approval to continue using English as the medium of instruction was granted by the Education Department in January, 1998.</P>
<P>Align=Bottom<BR><IMG align="bottom" src="images/csk_badge.gif"> Chan Sui Ki (La Salle) College, which was founded in 1969, is one of the five Lasallian secondary schools in Hong Kong. The motto of our school in Latin is LAUS DEO SEMPER, which actually means 'Praise be to God always'. English has been used as the medium of instruction in our school since its establishment in 1969. Approval to continue using English as the medium of instruction was granted by the Education Department in January, 1998.</P>
<P>Align=Left<BR><IMG align="left" src="images/csk_badge.gif"> Chan Sui Ki (La Salle) College, which was founded in 1969, is one of the five Lasallian secondary schools in Hong Kong. The motto of our school in Latin is LAUS DEO SEMPER, which actually means 'Praise be to God always'. English has been used as the medium of instruction in our school since its establishment in 1969. Approval to continue using English as the medium of instruction was granted by the Education Department in January, 1998.</P>
<P>Align=Right<BR><IMG align="right" src="images/csk_badge.gif"> Chan Sui Ki (La Salle) College, which was founded in 1969, is one of the five Lasallian secondary schools in Hong Kong. The motto of our school in Latin is LAUS DEO SEMPER, which actually means 'Praise be to God always'. English has been used as the medium of instruction in our school since its establishment in 1969. Approval to continue using English as the medium of instruction was granted by the Education Department in January, 1998.</P>
</BODY>
</HTML>

Note that only the text inline with the image follows the selected align option for "top", "middle", and "bottom". However, for the option "left" or "right", the image floats agianst the corresponding margin, and the text wraps along the entire height of the image.

 

The vspace and hspace attributes of the <IMG align=value vspace=v_value hspace=h_value src=imageURL> tag define spacing between text and floating images (i.e., when value="left", or value="right").

Both v_value and h_value are measured in pixels.

Click here to review how the following document appears in a Web browser.

<HTML>
<HEAD>
<TITLE>Enter the Page Title Here</TITLE>
</HEAD>
<BODY>
<IMG align="left" vspace=24 hspace=24 src="images/csk_badge.gif"> Chan Sui Ki (La Salle) College, which was founded in 1969, is one of the five Lasallian secondary schools in Hong Kong. The motto of our school in Latin is LAUS DEO SEMPER, which actually means 'Praise be to God always'. English has been used as the medium of instruction in our school since its establishment in 1969. Approval to continue using English as the medium of instruction was granted by the Education Department in January, 1998.
</BODY>
</HTML>

Note that extra spacing has been added between text and the floating image.

 

The width and height attributes of the <IMG src=imageURL width=w_value height=h_value> tag tell the Web browser the dimensions of the images in pixels so that the browser can lay in the text before actually starting to retrieve the images.

e.g., <IMG src="images/csk_badge.gif" width=118 height=130 >

 

The alt attributes of the <IMG src=imageURL alt=description> tag defines a text string that replaces the image in Web browsers without graphics support.

e.g., <IMG src="images/csk_badge.gif" alt="CSK School Badge">