Insert image in HTML page

HTML <img> tag


The <img> tag is used to embed an image in an HTML page.

Images are not technically inserted into a web page; images are linked to web pages. It is a unpaired tag. It has various attributes like: src, width, height, title, alt, border.
  • src attribute indicates the source, source image name or full path of the source image is given as a value to src attribute.
  • width attribute is used to set the width of the image.
  • height attribute is used to set the height of the image.
  • title attribute: when we mouse over the image the value given to the title attribute is displayed as a tool tip.
  • border attribute used to set the border to image.
  • alt attribute is used to give an alternate text for the image, when source image is not available at specified location then alternate text will get display in place of the image.

Example


<html>
<body>
<img src="shape.jpg" alt="Shape" width="400px" height="450px">
</body>
</html>
For live demo, go through Youtube video:


Comments

Popular Posts

How to Import and Export Delimited Files, like CSV, in PowerShell

PowerShell Arithmetic Operators

How to generate a GUID in PowerShell