Recents in Beach

IMAGE TAG IN HTML WITH ATTRIBUTES

IMAGE TAG IN HTML WITH ATTRIBUTES

<IMG> tag   is used to insert an image within a webpage. It uses following attributes :

  1. src : It is used to specify the path of an image file. The popular extensions of image file are png, jpg and gif. 
  2. height : Specifies height of the image in pixels. 
  3. width : Specifies width of the image in pixels. 
  4. alt : It is referred as alternate text. It  specifies the description of the image.

Note : Image Tag is a Empty Tag used to insert a image in web page but it will not work without src attribute . src attribute to specify path of image. Other attributes are optional .


Syntax of Img Tag:

<IMG src="launchpad.jpg" height="500" width="500" alt="image">


<html>

<head>

<title>web page</title>

</head>

<body>

<h1>Image tag in html</h1>

<img src="launchpad.png" height="400" height="400" alt="image">

</html>


Output:


Image Tag In Html


IMAGE TAG EXPLAINED IN DETAIL :







Post a Comment

0 Comments