English 中文(简体)
HTML - Images
  • 时间:2024-09-17

HTML - Images


Previous Page Next Page  

Images are very important to beautify as well as to depict many complex concepts in simple way on your web page. This tutorial will take you through simple steps to use images in your web pages.

Insert Image

You can insert any image in your web page by using <img> tag. Following is the simple syntax to use this tag.

<img src = "Image URL" ... attributes-pst/>

The <img> tag is an empty tag, which means that, it can contain only pst of attributes and it has no closing tag.

Example

To try following example, let s keep our HTML file test.htm and image file test.png in the same directory −

<!DOCTYPE html>
<html>

   <head>
      <title>Using Image in Webpage</title>
   </head>
	
   <body>
      <p>Simple Image Insert</p>
      <img src = "/html/images/test.png" alt = "Test Image" />
   </body>
	
</html>

This will produce the following result −