<img> for Embedding an Image

The img element embeds an image into an HTML document. To embed an image, you need to use the src and alt attributes.

The src attribute specifies the URL for the image. The alt attribute defines the fallback content for the img element.

This content of alt will be shown if the image cannot be displayed. You use the width and height attributes to specify the size (in pixels) of an image.

 
<!DOCTYPE HTML>
<html>
<head>
<title>Example</title>
</head>
<body>
      <p>
            <img src="http://www.java2s.com/style/download.png" alt="An Image" width="200" height="67" />
      </p>
</body>
</html>
  
Click to view this demo.
Home 
  HTML CSS Book 
    HTML  

img:
  1. <img> for Embedding an Image
  2. Embedding an image in a hyperlink
Related: