Page 64 - Trackpad_V1_Book 7_Flipbook
P. 64
IMAGES IN HTML5
Images enhance the look of a webpage and make it attractive. These are used for conveying
information and catching the attention of website-visitors. The most widely used image formats
supported by HTML are GIF, JPEG and PNG. The images on a webpage can be inserted using the
<IMG> tag, which is an empty tag. It has the following attributes:
Attribute Value Description
URL (or location) of the SRC stands for source. It specifies the
SRC
image location of the image.
ALT stands for alternate text. It specifies
ALT Text which alternative text should be displayed,
if selected image is not displayed.
Except for SRC attribute, all other attributes are optional in the <IMG> tag.
Syntax of <IMG> tag:
<IMG SRC=“URL of the image” ALT=“alternate text” WIDTH=“500” HEIGHT=“600”>
ALT = “Alternate Text”
WIDTH = “Value of width in pixels”
HEIGHT = “Value of height in pixels”
ALIGN = “Alignment Type”
Write HTML code for inserting an image on a webpage.
<!DOCTYPE HTML>
<HTML>
<HEAD>
<TITLE> Inserting Images </TITLE>
</HEAD>
<BODY>
<H1 ALIGN = "CENTER"> Valley of Flowers </H1>
<IMG SRC = "D:\Valley_of_Flower.jpg"> </CENTER>
<P> Valley of Flowers National Park is an Indian nationa1 park, located
in North Chamoli and Pithoragarh, in the state of Uttarakhand and is
known for its meadows of endemic alpine flowers and the variety of flora.
</P>
</BODY>
</HTML>
62 Trackpad (Version 1.0)-VII

